Hello:
I am having 2 dropdown list with states and forms and when i select the state it will populate corresponding forms of that state. When i select a form from the forms dropdown the event is firing but cannot display the url page
Following is the script i have written
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“
<html>
<head>
<title>Any Title</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<script type=”text/javascript”>
var forms= [];
forms[0] = [“A-4″,”A-4E”];
forms[1] = [“No Withholding Tax”];
forms[2] = [“A-4″,”WEC”,”A-4V”,”A-4M”,”WECI”];
function fillSelect(nValue,nList){
nList.options.length = 1;
var curr = forms[nValue];
for (each in curr)
{
var nOption = document.createElement(‘option’);
nOption.appendChild(document.createTextNode(curr[each]));
nOption.setAttribute(“value”,curr[each]);
nList.appendChild(nOption);
}
}
</script>
<style type=”text/css”>
body {background-color:#eae3c6;margin-top:60px}
form {width:330px;margin:auto}
fieldset {width:330px;background-color:#f0fff0;border:1px solid #87ceeb}
legend {font-family:times;font-size:14pt;color:#00008b;background-color:#87ceeb;padding-left:3px;padding-right:3px;margin-bottom:5px}
label {font-family:times;font-size:12pt;color:#00008B;padding:5px}
select {font-family:tahoma;font-size:10pt;width:125px;margin-left:27px}
.submitBtn {display:block;margin-left:auto;margin-right:auto;margin-top:5px;margin-bottom:5px}
</style>
</head>
<body>
<form method=”post” action=””>
<fieldset>
<select name=’states’ onchange=”fillSelect(this.value,this.form[‘forms’])”>
<option value=””>Select Your State</option>
<option value=”0″>Alabama</option>
<option value=”1″>Alaska</option>
<option value=”2″>Arizona</option>
</select>
<select name=’forms’
OnChange=”window.open(form.forms.options[form.forms.selectedIndex].value);
return false;”>
<option value=””>Select Form</option>
</select>
</fieldset>
</form>
</body>
</html>
Please Help
Thanks