Hi, How can i make this go to different page on browser? <select onChange="javascript:changeLocation(this)" target="_blank"> <option selected>--Select--</option> <option value="http://google.com">google.com</option> <option value="http://yahoo.com">yahoo.com</option> </select> <script type="text/javascript"> function changeLocation(menuObj) { var i = menuObj.selectedIndex; if(i > 0) { window.location = menuObj.options[i].value; } } </script> Code (markup): Thanks for the helps
<script> function changeLocation(menuObj) { window.open(menuObj.options[menuObj.selectedIndex].value); } </script> HTML:
yes that work, thanks for this, but a little more with the blank selected option <option selected>--Select--</option> also linked to blank page, and if i changed to <option value="index.php?page=the_page/#" selected>--Select--</option> this is will open the same page with different window/tab there another idea that no change for default selected above?
Leave it to value = "" and change the code to : <script> function changeLocation(menuObj) { if(menuObj.options[menuObj.selectedIndex].value.length > 0) window.open(menuObj.options[menuObj.selectedIndex].value); } </script> HTML: