Try our conversational search powered by Generative AI!

Updating hidden field with javascript. The value doesn't submit.


I've got a couple of Hidden fields where I'm setting the values with jQuery but the values don't come through in the submission.Data array.

I can see in the browser dev tools that it is set.

Any clues? 

Jul 12, 2019 22:11


Your fields are Pre-defined hidden element blocks or custom hidden element blocks (inherit from HiddenElementBlockBase) ?

And how do you set those values, on page load or right before xhr request is sent ?

Edited, Jul 16, 2019 10:13

Hi Kenny,

I've given it a try with an Alloy site with forms added and tried modifying the value of a hidden field via JavaScript and it posted the data correctly for me. To follow on from what Quan said, I wonder whether the issue is that the data is being posted before the value is being updated.

Jul 16, 2019 17:12

Sorry for the late reply, I had to reinstall everything on my laptop and we've been moving out of our house. :( 

These were custom hidden element blocks updated during page load. I was able to workaround the issue by storing the value in a cookie and then using a FormElementBlock that reads the cookie.

Jul 29, 2019 19:55
* 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.