How to add a combo box dynamically at run time in Java script?

Showing Answers 1 - 2 of 2 Answers

Kannappan

  • Jul 31st, 2006
 

you can use any looping statements or multiple statements of below code

document.forms[0].<combobox name>.options[index]= new Option(Appearingtext,Value)

Ex:

for (var i=0;i<5;i++)
{
document.forms[0].cmb1.options[i]= new Option("Test"+i,i)
}

  Was this answer useful?  Yes

document.forms[0].<combobox name>.options[index]= new Option(Apearingtext,value)

for (var i=0;i<5;i++)
{
document.forms[0].cmb1.options[i]= new Option("Test"+i,i)
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions