Jump to content


Photo

Menu list help needed


  • Please log in to reply
1 reply to this topic

#1 mum4d

mum4d
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 12 April 2006 - 09:20 AM

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
<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>

Thanks in advance!

#2 bonaparte

bonaparte
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts
  • Location#172, I Floor, 'Hamsashree', Defence Colony, Sahakaranagar, Bangalore, India

Posted 12 April 2006 - 09:45 AM

[!--quoteo(post=363942:date=Apr 12 2006, 04:20 AM:name=mum4d)--][div class=\'quotetop\']QUOTE(mum4d @ Apr 12 2006, 04:20 AM) View Post[/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
<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>

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.c...m-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.








0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users