acidglitter Posted April 6, 2008 Share Posted April 6, 2008 I have a simple form like.. <select id="select"> <option>Option1</option> <option>Option2</option> </select> If I check off a box or something, what javascript code would change the select form so the 2nd option is selected? Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted April 7, 2008 Share Posted April 7, 2008 This should work ;-) <form> <select id="select" name="select"> <option value="Option1">Option1</option> <option value="Option2">Option2</option> </select><input type="checkbox" onchange="document.forms[0].select.value='Option2';" /> </form> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.