London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Hidden input on all forms

Vote:
0

I have a form block that has its own PostSubmissionActorBase which will submit data to an external API with the form data. One of the fields i need to submit is the current locale of the submission however when i get the CultureInfo.CurrentCulture inside the PostSubmissionActorBase it is always set to the default locale "en".

A soloution i had was to add a hidden input element to the FormContainerBlock.cshtml this sets the correct value in the browser but when clicking submit the input isn't set with the payload to /EPiServer.Forms/DataSubmit/Submit. I could create my own custom element property block but this will then have to be added manually to every form.

        <input type="hidden" class="Form__Element Form__SystemElement FormHidden FormHideInSummarized" name="__CultureCode" value="@CultureInfo.CurrentCulture.Name" data-f-type="hidden" autocomplete="off" />
#330827
Oct 02, 2024 16:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.