If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

textarea clear right before submit saves information outside of tag

Hey, I have a weird problem, the task I'm trying to accomplish is to clear a textarea tag right before submitting form. I can see that the text inside the tag disappears, however, upon submit to the (Spring) controller, the parameter contains value that looks to be equivalent to n number of characters from the html right after the text area tag, some of the input is garbage, some is understandable. I've tried searching the web, but couldn't find any hits with similar description, maybe someone can shed some light on what I'm missing.

I've tried accessing the textarea through both id and name
I've tried setting the value and innerHTML attributes to empty
I've tried clearing different textareas on the form, and multiple at the same time

All of the above led to the same result.

One experiment where I got some headway is while trying to see the actual values of the textareas right before the submit I noticed that if there is an alert statement sitting right before the .submit() function the value gets properly cleared and the request parameter does not contain any data. It almost seems as if there is some time required to clear out the information, or the text is marked somehow in memory and does not get cleared until some user action occurs.

You are correct in assuming the intended functionality of the functions, however, they are out of scope of this problem. I got rid of them altogether and shrunk the code down to this (I removed all of the other dynamic content and this is the exact html source of the generated page out of jsp):

You are correct in assuming the intended functionality of the functions, however, they are out of scope of this problem. I got rid of them altogether and shrunk the code down to this (I removed all of the other dynamic content and this is the exact html source of the generated page out of jsp):
...

At this point I am not entirely sure if it is even a javascript question anymore.

Well, I guess just ignore my input. It was a guess because you had not provided much code with which to help.
Now having seen the rest how you were approaching the problem and your folllow-up post,
I'm inclined to agree with you that it is not a JS problem. More likely a browser incompatibility.

MSIE is kind of picky with the <!doctype ...> tag information. You might try various versions of this
with perhaps 'strick' or 'transitional' settings.

Also, the use of 'language=Javascript' and the <!-- //--> tags is somewhat archaic.
First should be <script type="text/javascript">
and the latter should be deleted entirely with modern browsers.