Search code examples
phpselectedtext

Get value from Dropdown in PHP with onchange event


Good morning everyone !

Here's the situation; I have 2 dropdownlists, the first one contains some informations.. the second one, contains names of some people.

They both are filled from database.

What I want to do, is when a name is selected in the second Dropdownlist, i want automaticly to trigger a function that updates the 1st dropdownlist, using the selected text of 2nd dropdownlist in the WHERE clause of SQL Query..

I can do this in JAVA or .NET languages, but i'm new in PHP..

So can you please help me ?


Solution

  • Here is a very good tutorial for same

    http://www.yourinspirationweb.com/en/how-to-create-chained-select-with-php-and-jquery/

    LoneWOLFs is right. its not possible using php only, to trigger onChange you will required javascript