I have a text area with some text. I also have an "onsubmit" event handler. In that I have an alert of the text area's innerHTML and I get back the text that is inside of the textarea. I then try to assign this to the "value" attribute of a hidden input element. However the value is never assigned, when the form posts, the hidden element has no value.
I've even tried something like this
hiddenElement.value = "please work " + textarea.innerHTML;
and that doesn't work either, however when I do this and submit the form, the form handler (a jsp page) shows that "please work" was received as the hidden input.
I've also checked firebug and the hidden element only ever submits "please work" and not the innerHTML of the text area.
What am I missing?