• 0

Dynamic form


Question

Nesvik

Hi.

I need to make the options of one dropdown change acording to what is chosen on another dropdown.

so if opt1 is choosen in the first box, sub1 and sub2 would show in the second, if opt2 is chosen in the first box sub3 nd sub4 would show in the second box. something like that.

I did manage to make a script in Javascript that did this after searching the web for info. unfortunately, this meant I had to set the value to a numberic value for the script to recognice. I need both the value and text of each option to be fully customizable.

thanks a lot

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
GatorV

you need to use the new Option constructor for populating combo boxes.

for example:

var sel = document.getElementById( "sel_box" );
sel.options[sel.options.length] = new Option( label, value );

See this for more info

Link to post
Share on other sites
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.