Hi Everyone,
we have 2 dropdowns and a textbox. choice made in dropdown1 populates dropdown2. how do we populate the value from dropdown2 to a textbox, when a dropdown2 has only one option. we have used the onchange functions in dropdown1 and 2
below is the code we have, which works for dropdown2 with multiple options.
var groups=document.form1.dropdown1.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group=new Array()
group[0][0]=new Option("Please Select one of the options")
group[1][0]=new Option("1 - Agent did not complete all necessary requirements for a 2.")
group[2][0]=new Option("2 - Agent omitted salutation from required Greeting.")
group[3][0]=new Option("3 - Agent added salutation to required Greeting.")
group[3][1]=new Option("3 - Agent added salutation to required Greeting111.")
group[3][2]=new Option("3 - Agent added salutation to required Greeting222.")
var temp=document.form1.dropdown2
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=new Option(group[x].text,group[x].value)
}
temp.options[0].selected=true
}
function showtext(){
var txt
txt=document.form1.dropdown2.options[document.form1.dropdown2.selectedIndex].text
document.form1.textbox.value=txt
}
Any help is appreciated..
DSDA7
we have 2 dropdowns and a textbox. choice made in dropdown1 populates dropdown2. how do we populate the value from dropdown2 to a textbox, when a dropdown2 has only one option. we have used the onchange functions in dropdown1 and 2
below is the code we have, which works for dropdown2 with multiple options.
var groups=document.form1.dropdown1.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group=new Array()
group[0][0]=new Option("Please Select one of the options")
group[1][0]=new Option("1 - Agent did not complete all necessary requirements for a 2.")
group[2][0]=new Option("2 - Agent omitted salutation from required Greeting.")
group[3][0]=new Option("3 - Agent added salutation to required Greeting.")
group[3][1]=new Option("3 - Agent added salutation to required Greeting111.")
group[3][2]=new Option("3 - Agent added salutation to required Greeting222.")
var temp=document.form1.dropdown2
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=new Option(group[x].text,group[x].value)
}
temp.options[0].selected=true
}
function showtext(){
var txt
txt=document.form1.dropdown2.options[document.form1.dropdown2.selectedIndex].text
document.form1.textbox.value=txt
}
Any help is appreciated..
DSDA7