Hi !
I want to have two drop down menus in my form.
The second one populates automatically upon selection from the first drop down menu.
following code is working fine in html file both in ie and firefox. But its not working when using it with chronoform.
Please tell me how can I incorporate this in my chronoform.
regards
Cs
I want to have two drop down menus in my form.
The second one populates automatically upon selection from the first drop down menu.
following code is working fine in html file both in ie and firefox. But its not working when using it with chronoform.
<form name="doublecombo">
<p><select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
<option>South</option>
<option>North</option>
<option>Central</option>
</select>
<select name="stage2" size="1">
<option value="Mohammed Khan">Mohammed Khan</option>
<option value="Zahir Zaidi">Zahir Zaidi</option>
</select>
<script>
<!--
/*
Double Combo Script Credit
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScripts here!
*/
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("Mohammed Khan","Mohammed Khan")
group[0][1]=new Option("Zahir Zaidi","Zahir Zaidi")
group[1][0]=new Option("Farhan Durrani","Farhan Durrani")
group[1][1]=new Option("Rudaba Zehra Nasir","Rudaba Zehra Nasir")
group[2][0]=new Option("Naeem Malik","Naeem Malik")
group[2][1]=new Option("Natasha","Natasha")
var temp=document.doublecombo.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
//-->
</script>
</form>
Please tell me how can I incorporate this in my chronoform.
regards
Cs