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
https://forums.phpfreaks.com/topic/72159-selected-box-action/
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
https://forums.phpfreaks.com/topic/72159-selected-box-action/#findComment-364051
Share on other sites

Archived

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

×
×
  • 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.