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? Quote Link to comment 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 Quote Link to comment 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()" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.