drop down menu validation to a redirect URL

wxdqz

New Member
I have a one drop down menu form with a Yes or No to select. Basically, depending on whether they select Yes or No the user will be redirected to a different page. It seems like it would be so simple but I'm definately missing something and I am no javascript coder so any suggestions would be great!

<SCRIPT LANGUAGE=javascript>
<!--
function sendData()
{
var okToSend = true;

document.frmQuestion.hdnRequestorName.value = "<%=strRequestorName%>";
document.frmQuestion.hdnRequestorPhone.value = "<%=strRequestorPhone%>";
document.frmQuestion.hdnRequestorEmail.value = "<%=strRequestorEmail%>";
document.frmQuestion.hdnRequestType.value = "<%=strRequestType%>";
document.frmQuestion.hdnWebServer.value = "<%=strWebServer%>";
document.frmQuestion.hdnRedirectURL.value = "<%=strRedirectURL%>";


if (document.frmQuestion.selWebServer.selectedIndex == 0)
{
alert ("Please select Yes or No in order to continue.");
document.frmQuestion.selWebServer.focus();
return false;
okToSend = false;
}

//****I know this is wrong but this is the section I'm having trouble with...
if (document.frmQuestion.selWebServer.value = "Yes")
{
strRedirectURL = "webserver.asp"
}
if (document.frmQuestion.selWebServer.value = "No")
strRedirectURL = "oopsie.asp"
}


//document.frmQuestion.action = "getVariableValues.asp";
//document.frmQuestion.action = "testresults.asp";
document.frmQuestion.action = "<%=strRedirectURL%>";
document.frmQuestion.submit();
}
//-->
</SCRIPT>



here is the html drop down menu section...
<table align=center border=2 borderColor=#000000 cellPadding=1 cellSpacing=1 width=400>
<tr><td bgColor="#004A84" borderColor=black>

<p align="center" style="font-size: 12pt; font-weight: bold">
<font color="#FFFFFF" face="Arial">Is this request for a Web Server?</font></td></tr>
<tr><td borderColor=#000000>
<p align="center"><select size="1" name="selWebServer">
<option selected value=http://www.webdeveloper.com/forum/archive/index.php/"Select One:">Select One:</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td></tr></table>
 
Top