Jump to content

Menu list help needed


mum4d

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!
Link to comment
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.



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.