jquery changing select dropdown values

Posted by user962449 on Stack Overflow See other posts from Stack Overflow or by user962449
Published on 2012-04-03T05:25:03Z Indexed on 2012/04/03 5:29 UTC
Read the original article Hit count: 233

Filed under:
|

I'm trying to change a dropdown select menu with jqquery by selecting a certain option from a dropdown menu.

Example:

<select name="options">
    <option value='3'>Option 3</option>
    <option value='5'>Option 4</option>
    <option value='7'>Option 5</option>
</select>

The other dropdown:

<select name="rounds">
    <option value='1'>1</option>
    <option value='3'>3</option>
    <option value='5'>5</option>
    <option value='7'>7</option>
</select>

Say someone selects option 4, then the other dropdown will dynamicly change its values to say:

<select class='button' name="rounds">
    <option value='23'>23</option>
    <option value='5'>5</option>
    <option value='12'>12</option>
</select>

Each option will change the rounds menu and users can toggle between options. Anyway to do this? is there a demo online?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about dropdown