Grabbing HTML Dropdown selection variable

Hi Coders,

I am trying to figure out a way to grab the selection from an HTML dropdown box (dropdown options are displayed via PHP) as soon as it is selected. I do not want to have to have the user click a “submit” button in order for me to be able to grab that variable’s value. Anybody know a solution? (I am not even sure if this is a PHP problem or strictly front-end…)

You want AJAX or javascript with an on change event

dropdown options are displayed via PHP)
No they are not.

JavaScript has an OnChange event. You need to look into that, like Kevin said.

astonecipher I meant that my dropdown options are being displayed via PHP, since I am pulling them from a database. I am currently working on a solution via jQuery/JavaScript & so far so good. Thanks for the replies!!

I understood what you meant. PHP doesnt display anything though.

Sponsor our Newsletter | Privacy Policy | Terms of Service