Jump to content

dropdown with redirect in PHP


dannyd

Recommended Posts

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

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>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.