volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

AI OnAI Off

Hidden input on all forms

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.