Jump to content

PHP/MYSQL & JAVASCRIPT


GregL83

Recommended Posts

I want to create a form with menu options that dynamically affect other options. An example is a menu listing states and cities. When the state is selected the corresponding cities are loaded into the next associated menu. I already know how to do a simple form of this; however, I would like to make it more complex. (tutorial : www.hscripts.com/scripts/JavaScript/dynamic-form-event.php). Would it be possible to have the first selected value pull more values from a MYSQL DB using PHP? Or, will I be required to pull all the corresponding values first and echo them in javascript like demonsrated in the tutorial linked in paranthesis above^ ? Thank you for your time...

Link to comment
Share on other sites

You can use AJAX to have Javascript send a request to a PHP script telling it which item was selected and the PHP script could determine the list of options for the second dropdown and send that list back to Javascript, which would update the element on the page.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...