question about forms
My page displays multiple pairs of fields in which a choice in the first field creates a specific list in the second field. The data is returned from a SQL Server 200 database, and the page works fine if the user doesn't go back and change one of the first fields in the pair. If they do make a change to the first field, the page displays the change in the second field but doesn't set the variable to push the second field's change to the next page.
I am using emp_name = request.form("employee_name") at the beginning of the page to get the form data, and using the following in the body to build and submit the data for the second part of the pair:
<td width="312"><select size="1" name="employee_name" style="font-family: Verdana; font-size: 10pt; width: 341; height:22" tabindex="4" onchange=submit()>
<% Do while not connEmp.eof
If emp_name = connEmp("Employee_Name") Then
Response.write "<OPTION Select VALUE='" & connEmp("Employee_Name") & "'" & " selected>"
Response.write connEmp("Employee_Name")
Response.write "</OPTION>"
Else
Response.write "<OPTION VALUE='" & connEmp("Employee_Name") & "'>"
Response.write connEmp("Employee_Name")
Response.write "</OPTION>"
End If
connEmp.MoveNext
Loop
%>
</select></td>
If I modify another field the second pair value gets changed. I looked online for answers and tried some approaches without success. I was able to modify a JavaScript function that validates field values to focus on the second fields and re-submit the values, but it only worked in FireFox and not in IE7. I also tried to redirect from the function to get IE7 to work but that didn't work either.
More info that might help you help me: I have one form to handle all of the fields, and another form that is solely the submit button.
<form method="post" action="service_request_by_IT_submit.asp" name="frmServiceRequestSubmit" onSubmit="return Validate()">
<table border="0" width="800" id="table3" cellspacing="0" cellpadding="0" height="25">
<tr>
<td width="800" align="center"> <b>
<input type="submit" value="Submit Data" name="btn1"
style="font-size: 12pt; font-family: Verdana; font-weight: bold;" tabindex="6"></b></td>
</tr>
</table>
Form for fields looks like this:
<form method="post" action="service_request_by_IT.asp" name="frmServiceRequest" onSubmit="return Validate()">
Thanks for your time and attention.
|