html post issue
- by Amarsh
i have the following html code :
<FORM name=frmmail>
<input id="dochtmlContent" type="hidden" name="dochtmlContent" value="oldValue"/>
<script>document.dochtmlContent="newValue"</script>
</FORM>
and later on in a javascrip function (which is called upn submit):
alert(document.dochtmlContent);
document.frmmail.method = "post";
document.frmmail.ENCTYPE = "application/x-www-form-urlencoded";
document.frmmail.action = "/myServlet";
document.frmmail.submit();
Basically, I am declaring a hiden variable, changing its value and submitting it.
The issue is, while I see an alert box displaying "newValue", when I submit it, my servlet recieves the "oldValue" for the dochtmlContent parameter.
Can someone suggest whats wrong here.