Page 1 of 1

how to execute a query depending on the value selected

Posted: Fri Jan 14, 2011 4:31 am
by kaif
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

Re: how to execute a query depending on the value selected

Posted: Fri Jan 14, 2011 6:12 am
by mellowman
This seems to be more of a javascript along with php then just php...i suggest you look into a Jquery plugin...sense its the easiest and most likely someone has already created the code for you...it might need some manipulation though. :D

Re: how to execute a query depending on the value selected

Posted: Fri Jan 14, 2011 6:28 am
by awebtech
If you want to populate fields without page refresh - ajax is your choice. And you can use jQuery methods (get, post, ajax) to work with ajax on the "high" level.

Re: how to execute a query depending on the value selected

Posted: Sat Jan 15, 2011 6:27 am
by kaif
Thanks a lot for your response,

I don't know the ajax programming. :(

Please can you provide me the code

Once again thanks for your response

Re: how to execute a query depending on the value selected

Posted: Sat Jan 15, 2011 9:00 am
by awebtech
You are welcome.

Actually, ajax is not complicated technology.

Just read few tutorials, like this one:
http://www.developertutorials.com/tutor ... query-874/
or this one:
http://articles.sitepoint.com/article/ajax-jquery

Re: how to execute a query depending on the value selected

Posted: Mon Jan 17, 2011 12:52 am
by kaif
hi, awebtech

Very very Thanks :D