george Posted September 17, 2007 Share Posted September 17, 2007 <select name="Cancer Facts" style="font-family: Arial; font-size: 13px" onchange="MM_jumpMenu('parent',this,0)"> <option value="http://www.cancerproject.org/diet_cancer/facts/factors.php" selected>Factors Contributing to The select -> option code is not within form tags, because the javascript handels the event onchange. One can not select the first "selected" option. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 18, 2007 Share Posted September 18, 2007 Is there supposed to be a question there somewhere or are you just giving out code? Link to comment Share on other sites More sharing options...
george Posted September 19, 2007 Author Share Posted September 19, 2007 Is there supposed to be a question there somewhere or are you just giving out code?How can I make the dropdown menu select the first option in a list of options, when the first option is pre-selected? In the example given, an onchange event is used. <select name="Cancer Facts" onchange="MM_jumpMenu('parent',this,0)"> <option value="http://www.php1" selected>Option 1</option> <option value="http://www.php2" >Option 2</option> When the user tries to select the first item by clicking on it, nothing happens. Since the indexed item did not change, the onchange event is not triggered. I tried using the onmouseup event and the onclick event, and that was no help. How do I capture the event? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 19, 2007 Share Posted September 19, 2007 Manually execute the function that runs onchange after you create the select menu. You can put it in onload. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.