Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect Browser w/ Validation Not Working

Status
Not open for further replies.

OrWolf

MIS
Mar 19, 2001
291
I'm trying to redirect the user and validate data input into two drop-down boxes. However the two pieces of code don't seem work together.

This works to redirect, but doesn't validate that the user input anything into the drop-down boxes:
<form method=&quot;POST&quot; name=&quot;SendMe2&quot;>
<p align=&quot;left&quot;><select size=&quot;1&quot; name=&quot;FacilityDD&quot; tabindex=&quot;10&quot;>
<option selected>Select a Facility</option>
&nbsp;
<%
Do While Not objRecordset.EOF
%>
<option VALUE=&quot;<%=objRecordset(&quot;Facility&quot;)%>&quot;>
<%=objRecordset(&quot;Facility&quot;)%></option>
<%
objRecordset.MoveNext
Loop ' keep the loop
%>
</select></p>
<p align=&quot;left&quot;><select size=&quot;1&quot; name=&quot;SurveyType&quot; tabindex=&quot;20&quot;>
<option selected>Select a Survey Type</option>
<option value=&quot;RA_DSurveyDept.asp&quot;>Department</option>
<option value=&quot;RA_OSurveyOrg.asp&quot;>Organization</option>
</select></p><input type=&quot;button&quot; value=&quot;Continue&quot; name=&quot;Continue&quot; tabindex=&quot;500&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot; tabindex=&quot;510&quot;>

<SCRIPT FOR=&quot;Continue&quot; EVENT=&quot;onClick&quot; LANGUAGE=&quot;VBScript&quot;>
dim choice
choice = document.SendMe2.SurveyType.selectedindex
navigate document.SendMe2.SurveyType.options(choice).value
</SCRIPT>
</form>


This code does nothing when the user presses the continue button:
<form method=&quot;POST&quot; name=&quot;SendMe2&quot;>
<p align=&quot;left&quot;><!--webbot bot=&quot;Validation&quot; S-Display-Name=&quot;Facility&quot;
B-Value-Required=&quot;TRUE&quot; B-Disallow-First-Item=&quot;TRUE&quot; --><select size=&quot;1&quot; name=&quot;FacilityDD&quot; tabindex=&quot;10&quot;>
<option selected>Select a Facility</option>
&nbsp;
<%
Do While Not objRecordset.EOF
%>
<option VALUE=&quot;<%=objRecordset(&quot;Facility&quot;)%>&quot;>
<%=objRecordset(&quot;Facility&quot;)%></option>
<%
objRecordset.MoveNext
Loop ' keep the loop
%>
</select></p>
<p align=&quot;left&quot;><!--webbot bot=&quot;Validation&quot; S-Display-Name=&quot;Survey Type&quot;
B-Value-Required=&quot;TRUE&quot; B-Disallow-First-Item=&quot;TRUE&quot; --><select size=&quot;1&quot; name=&quot;SurveyType&quot; tabindex=&quot;20&quot;>
<option selected>Select a Survey Type</option>
<option value=&quot;RA_DSurveyDept.asp&quot;>Department</option>
<option value=&quot;RA_OSurveyOrg.asp&quot;>Organization</option>
</select></p><input type=&quot;button&quot; value=&quot;Continue&quot; name=&quot;Continue&quot; tabindex=&quot;500&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot; tabindex=&quot;510&quot;>

<SCRIPT FOR=&quot;Continue&quot; EVENT=&quot;onClick&quot; LANGUAGE=&quot;VBScript&quot;>
dim choice
choice = document.SendMe2.SurveyType.selectedindex
navigate document.SendMe2.SurveyType.options(choice).value
</SCRIPT>
</form>

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top