Jump to content

selected box action


zgkhoo

Recommended Posts

hi,

may i know how to set the respond to action when user choose an option inside a <select></select> box?

eg.

when user select an option in the <select> box then php search for data inside mysql and then display the required data on the <input type=text> ,

anyone can lead me or provide me the link of tutorial pls..

thank you very much.

Link to comment
Share on other sites

if i understand, you want PHP to do something when an option is selected in a single <SELECT>. if so...

 

add a Javascript onchange() handler to your <SELECT> that either submits the form or uses Ajax to update the page. here is an example that just submits the form:

 

<SELECT NAME='some_name' onchange="this.form.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.