Page 1 of 1

display data from selected dropdownlist. help please

Posted: Mon Sep 14, 2009 10:22 pm
by iqa
Hello everyone!
i'm new here and looking some advices for my php project
I have problem to get data and display in the page from the selected value in dropdownlist.
The situasion is :
I had get employee num, value for dropdown using query from the employee table.
Now i want to display other data from the same table such as employee name, position and ect. in the page depend on selected value in drodown.
hope someone could give advice because i also newbie in php.
tq very much

Re: display data from selected dropdownlist. help please

Posted: Tue Sep 15, 2009 1:58 am
by CoderGoblin
What you are actually doing is a basic form function unless you actually wish to automate the process so the user doesn't have to click a "submit" button. In this case you need to look at AJAX. The thread Dynamic/Chained Selects using Ajax Prototype/JQuery may help with AJAX although it is quite old. Just bear in mind you are simply getting and displaying data rather than another combo box.

The main thing here is to break up the task and learn/understand each component. As far as I can see learn:

1) Basic form handling
2) Database queries

>> Combine the two to produce the necessary output

3) AJAX processing - if required