Jump to content

Archived

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

mum4d

Menu list help needed

Recommended Posts

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!

Share this post


Link to post
Share on other sites
[!--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 use

onchange='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.



Share this post


Link to post
Share on other sites

×

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.