Advertisement
NiTeWuRX

JS - Reload Page with Dropdown Select

Jun 26th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Found here:
  2. https://forums.digitalpoint.com/threads/loading-page-based-on-option-selected-when-option-changes-from-drop-down.285425/
  3.  
  4. <script type="text/javascript">
  5. function redirectMe (sel) {
  6.     var url = sel[sel.selectedIndex].value;
  7.     window.location = url;
  8. }
  9. </script>
  10.  
  11. <select name="myselect" onchange="redirectMe(this);">
  12.   <option value=" " selected>-=choose=-</option>
  13.   <option value="file.php?var=ALL">ALL</option>
  14. </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement