music_lp90 Posted July 21, 2007 Share Posted July 21, 2007 Hi, I'm trying to figure out how to make my form submit when a user selects an option from the pull down menu so that I don't have to have a button to submit it.Here's the code I have now. <form action="lbc_directory.php" method="post"><select name="alpha_last"> <option>A</option> <option>B</option> <option>C</option> <option>D</option> <option>E</option> <option>F</option> <option>G</option> <option>H</option> <option>I</option> <option>J</option> <option>K</option> <option>L</option> <option>M</option> <option>N</option> <option>O</option> <option>P</option> <option>Q</option> <option>R</option> <option>S</option> <option>T</option> <option>U</option> <option>V</option> <option>W</option> <option>X</option> <option>Y</option> <option>Z</option></select><input type="submit" value="Browse by Last Name"></form> So basically what I want is, when a user clicks the letter "A" or any other letter, the form will submit and I can get rid of the submit button that I have put in the form.Thanks for your help! Link to comment Share on other sites More sharing options...
king Posted July 21, 2007 Share Posted July 21, 2007 <select name="alpha_last" onchange="this.form.submit()"> Link to comment Share on other sites More sharing options...
music_lp90 Posted July 21, 2007 Author Share Posted July 21, 2007 Thanks, works great! Link to comment Share on other sites More sharing options...
jlhaslip Posted July 28, 2007 Share Posted July 28, 2007 Is that cross-browser friendly? will it work on IE, FF, Safari, netscape, etc? Link to comment Share on other sites More sharing options...
Synook Posted July 28, 2007 Share Posted July 28, 2007 Yes, it will work on all JavaScript enabled browsers. Link to comment Share on other sites More sharing options...
jlhaslip Posted July 28, 2007 Share Posted July 28, 2007 thank you for the code and the details. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.