mum4d Posted April 12, 2006 Share Posted April 12, 2006 I have created a List Menu in a form that makes a selection from a database. But I have had to put a button next to it to activate the selection. ie: 1)select an item from the menu, 2)then click the select button to make the selection and display the data from the database.How do I make it so I do not need to click the select button?? ie: 1) select an item from a menu and as soon as you release the mouse the data from the database is displayed??My form code looks like this[code]<form id="form1" name="form1" method="post" action=""> <select name="select"> <option>Choose a Catagory</option> <option value="form">form</option> <option value="NCR">NCR</option> <option value="Tags">Tags</option> </select> <input type="submit" name="Submit" value="Select" /> </form>[/code]Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/7183-menu-list-help-needed/ Share on other sites More sharing options...
bonaparte Posted April 12, 2006 Share Posted April 12, 2006 [!--quoteo(post=363942:date=Apr 12 2006, 04:20 AM:name=mum4d)--][div class=\'quotetop\']QUOTE(mum4d @ Apr 12 2006, 04:20 AM) [snapback]363942[/snapback][/div][div class=\'quotemain\'][!--quotec--]I have created a List Menu in a form that makes a selection from a database. But I have had to put a button next to it to activate the selection. ie: 1)select an item from the menu, 2)then click the select button to make the selection and display the data from the database.How do I make it so I do not need to click the select button?? ie: 1) select an item from a menu and as soon as you release the mouse the data from the database is displayed??My form code looks like this[code]<form id="form1" name="form1" method="post" action=""> <select name="select"> <option>Choose a Catagory</option> <option value="form">form</option> <option value="NCR">NCR</option> <option value="Tags">Tags</option> </select> <input type="submit" name="Submit" value="Select" /> </form>[/code]Thanks in advance![/quote]You need a form handler which can process the data submitted from the above form. In your form tag specify the action URI<form id="form1" name="form1" method="post" action="http://www.example.com/form-handler.php">In the form handler script write the code that displays the data from the database. To submit the form without hitting the submit button useonchange='this.form.submit.value = "Select"; this.form.submit()'>Also change the name of the submit to something other than submit. JavaScript won't work with the name of the submit button as submit. Quote Link to comment https://forums.phpfreaks.com/topic/7183-menu-list-help-needed/#findComment-26141 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.