Forum Moderators: open
<select name="districts" onchange="window.location = this.options[this.selectedIndex].value" style="background-color: #F88C01; color: #FFFFFF; font-size: 9pt">
<option value="">Select a District
<option value="http://www.bham.wednet.edu">Bellingham, WA
<option value="name.html">Bellingham, WA
<option value="name.html">Bullingham, MS
</select>
If I just want to options that are off-site to pop a new window, how would I modify this script?
Thanks for any help!
Tim
Besides, a select element is not meant to trigger functionality. It is counterintuitive to use such elements (selects, radio buttons, and checkboxes) as a trigger to a function that navigates away from the page. If anything, use the select box to let the user select which page to go to, but let him/her make the final decision on whether to actually go there or not.
Finally, the last argument -- what if the user has turned off JavaScript to avoid annoying functionality to be forced upon him/her? Then your select box would do absolutely nothing!
As a rule of thumb, your page should be accessible and usable even if a person has JavaScript turned off, and no matter if they use the keyboard or mouse to navigate. In the end, this means that the "Go" button (or whatever you will end up calling it) should not point to a JavaScript function that redirects the user. Instead, the form should properly point to a script on the server side that can handle the user input, and on the server side redirect the user to the page he/she desired to visit.