我需要一些有关 javascript 重定向的帮助。我有以下表单代码,但它不起作用。
<form name="getstarted" width="500">
<p>
<select name="trade" id="trade">
<option selected="selected" value = "">Please Select License Trade</option>
<option value = "A">A-General Engineering</option>
<option value = "B">B-General Building</option>
<option value = "C2">C2 - Insulation and Acoustical</option>
</select>
</p>
<p>Do you currently hold an <strong>active</strong> contractors license in California? <br /> <br />
<INPUT TYPE="radio" id="questions" NAME="questions" VALUE="y">Yes
<INPUT TYPE="radio" id="questions" NAME="questions" VALUE="n">No</p>
<input type="button" value="Next" onClick = "direction()" />
</form>
<script language="javascript">
function direction(value)
{
if((trade == "A") && (questions == "y"))
{window.location = "http://localhost:8080/Math/page1.html";}
else{window.location = "http://localhost:8080/Math/page2.html";}
}
</script>
<script type="text/javascript">
$(document).ready(function(){
$(".icon a.tooltips").easyTooltip();
});
</script>
我试图让此代码根据选择的两个不同选项重定向用户。
谢谢