How to execute a query depending on the value selected

hi,

how to populate the other fields by executing a query depending on the value selected in the list box.

I have a list box which is getting the values from the database.

For example:

student Id

st01
st02
st03

if the user selected st01 in the list it should populate the the student name and branch in the below two text boxes

Thanks
Samiuddin

From how you explained it this is what you want…

User selects a value from the drop down box
vvvvv
Upon selecting a value 2 text boxes are then populated with data synced to that user

Did i hit the nail on the head? If i did you would either need to use a static JavaScript .[B]innerHTML/B method or use Ajax to dynamically receive the data but using innerHTML would be a lot easier and faster.

Thanks for your response,

when the student selected the Id from the list box then i want to populate his name and branch from the database table in the below two form fields

please provide me the code

Thanks
samiuddin

I think it would be more beneficial to you in the long run if you tried to figure it out. SgtLegend gave you the terms to search for, either in google or here. They will lead you down the right path.

Right now i have a snippet of untested code but it does help a lot more to search for the correct code elements yourself as in my personal opinion you get no where if you copy what others write.