So, I am trying use an onchange event to call two different functions, one to change the form action and one to change the options in the next drop down, both dependent on the same selections in the first drop down list. Here is what I have, the action change works, it is the select list that is not working. Any thoughts?
And then within the form itself:
Thanks!
Code:
<script type="text/javascript">
<!--//
function changeAction(url)
{
if(url=="nofulfillment.asp") {
document.myform.action = "nofulfillment.asp";
}
else if (url=="fulfillment.asp") {
document.myform.action = "fulfillment.asp";
}
}
//-->
</script>
<script type="text/javascript">
<!--//
function SelectSubCat(url){
// ON selection of fulfill this function will work
removeAllOptions(document.myform.00N200000019CLw);
addOption(document.myform.00N200000019CLw, "", "--Product--", "");
if(url == 'nofulfillment.asp'){
addOption(document.myform.00N200000019CLw,"PCmover", "PCmover");
addOption(document.myform.00N200000019CLw,"Laplink Gold", "Laplink Gold");
addOption(document.myform.00N200000019CLw,"Laplink Everywhere", "Laplink Everywhere", "");
addOption(document.myform.00N200000019CLw,"PDAsync", "PDAsync");
addOption(document.myform.00N200000019CLw,"Conference Center", "Conference Center");
addOption(document.myform.00N200000019CLw,"RemoteAssist", "RemoteAssist");
}
if(url == 'fulfillment.asp'){
addOption(document.myform.00N200000019CLw,"PAFGPCMV03000P0EVDEN", "PCmover");
}
}
//-->
</script>
And then within the form itself:
Code:
<form name="myform" method="POST" action="fulfillment.asp">
<table cellpadding="6" cellspacing="0" border="0" align="center" ID="Table1">
<tr>
<td align="right" width="200">Fulfillment: </td>
<td><select id="fulfill" name="fulfill" onchange="changeAction(this.value); SelectSubCat(this.value);">
<option value="">--Select your fulfillment option--</option>
<option value="nofulfillment.asp"> Do Not Fulfill Trial
<option value="fulfillment.asp"> Fulfill Trial
</select></td></tr>
<tr>
<td align="right" width="200">Choose Product: </td>
<td><select id="00N200000019CLw" name="00N200000019CLw" title="00N200000019CLw">
<Option value="">--Product--</Option>
</select></td></tr>
Thanks!