Click to See Complete Forum and Search --> : Submit looses hidden field value


Bill Crawley
December 4th, 2003, 03:59 AM
Hi All,

I have :

document.forms[0].Update.value='yes';
document.myForm.submit;

in a routine.

I have declared a Hidden field called Update in my form. I have checked before the submit that the value does actually get set, but after Submission the value of Update is empty. I have checked everywhere and this is the only place in the page that this value is set.

Does anybody have any idea why my value is being lost on submit. My form is declared :
<FORM NAME="myForm" action="AgentDetail.asp" method="post">

Thread1
December 4th, 2003, 04:14 AM
Is the name property/attribute of the INPUT tag set...?

<input type="hidden" name="Update">

Bill Crawley
December 4th, 2003, 04:22 AM
This is the declaration:

<input type=hidden value="" name="Update">

Thread1
December 4th, 2003, 04:42 AM
Well, the following ASP code works in my browser. In the onsubmit event of the form the Update hidden field is set to "yes" and the server script will display the value.

<%
if Request.Form.Count > 0 then
Response.Write "Content of hidden field : " & Request.Form("Update")
end if
%>

<script for="form1" event="onsubmit()" language="javascript">
document.all("Update").value = "yes";
</script>

<form name="form1" method="post" >
<input type="hidden" name="Update">
<input type="submit">
</form>