thefortrees Posted June 25, 2007 Share Posted June 25, 2007 Hi all - I am trying to figure out how to click an option in a select menu and have that option act as a hyperlink/form submit without a submit button. Here is an example of what I am trying to do: echo "<select align='center'>" . "<option value='all' onChange='home.php?displayUsers='all'>All</option>" . "<option value='admin' onChange='home.php?displayUsers='admin'>Admin</option>" . "<option value='business' onChange='home.php?displayUsers='business'>Business</option>" . "<option value='personal' onChange='home.php?displayUsers='personal'>Personal</option>" . "</table>"; Any suggestions? Link to comment https://forums.phpfreaks.com/topic/57136-solved-selectoption-action/ Share on other sites More sharing options...
pocobueno1388 Posted June 25, 2007 Share Posted June 25, 2007 Well, this would be JavaScript, not PHP. This should help you: http://members.aol.com/grassblad/html/selMenu.html Link to comment https://forums.phpfreaks.com/topic/57136-solved-selectoption-action/#findComment-282308 Share on other sites More sharing options...
TreeNode Posted June 25, 2007 Share Posted June 25, 2007 Don't put the onChange event handlers on the options themselves, just put this on the select statement: onchange="this.form.submit()" Link to comment https://forums.phpfreaks.com/topic/57136-solved-selectoption-action/#findComment-282312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.