What is the best way to have a dynamic dropdownlist in PHP and POST selected value

Posted by mouthpiec on Stack Overflow See other posts from Stack Overflow or by mouthpiec
Published on 2010-04-10T17:40:58Z Indexed on 2010/04/10 17:43 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

Hi,

I am writing the following in PHP: i would like to have 2 dropdownlists, where the second one is populated from a mySQL dB according to the choice made on the first dropdown list. Then I would like to use the values of the selected values of the dropdownlist to call another PHP page in which I will generate a db query.

Eg: List A: Car Manufactures (honda, nissan, etc) List B: Models (accord, civic, etc)

Then I will have a submit button, to POST the values in another PHP file? (I have the basics of how to perform the above without having a dynamic list, but I tried this with AJAX, but I am having problems to pass the value of the second dropdownlist)

Any tips of how I can perform the above?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript