Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2007, 01:04 PM
Authorized User
 
Join Date: Jan 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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">&nbsp;<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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
continuous forms question hamffjs Access 3 January 29th, 2007 01:33 PM
Forms Question biglazy Access 3 December 23rd, 2005 12:22 PM
Forms question satts Access 3 February 18th, 2005 05:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.