dannyd Posted April 1, 2008 Share Posted April 1, 2008 This isnt working for me when I embed it into PHP: <select onChange=”window.open(this.options[this.selectedIndex].value)” name=”s1″> <option selected>pick one</option> <option value=’http://www.google.com’>google</option> <option value=’http://www.yahoo.com’>yahoo</option> </select> Is there a PHP version of creating a dropdown list with a redirect ? Link to comment https://forums.phpfreaks.com/topic/99001-dropdown-with-redirect-in-php/ Share on other sites More sharing options...
DyslexicDog Posted April 1, 2008 Share Posted April 1, 2008 There's no php code in your post... Link to comment https://forums.phpfreaks.com/topic/99001-dropdown-with-redirect-in-php/#findComment-506639 Share on other sites More sharing options...
papaface Posted April 1, 2008 Share Posted April 1, 2008 Yeah this isn't PHP. But you need to try something like this: <form name="redirecter"> <select name="links" class="dropdown" onChange="window.location=document.redirecter.links.options[document.redirecter.links.selectedIndex].value"> <option value="#">-- Navigation --</option> <option value='http://www.google.com'>google</option> ></select> </form> Link to comment https://forums.phpfreaks.com/topic/99001-dropdown-with-redirect-in-php/#findComment-506683 Share on other sites More sharing options...
dannyd Posted April 1, 2008 Author Share Posted April 1, 2008 thanks! Link to comment https://forums.phpfreaks.com/topic/99001-dropdown-with-redirect-in-php/#findComment-506693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.