Jump to content

Auto-Fill Forum


alicefreak

Recommended Posts

MY DropDown is working correctly. Can some one tell me how i can go abt the following:

I have a drop down menu with say 5 student name options and a text box which displays student address.

when I select one of the student name's i have to get the respective student address for the student name that i actually selected from drop down menu from my mysql database.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/211200-auto-fill-forum/
Share on other sites

ajax is definately the way...

 

you would do an onChange="doSomething();" on the drop down..

 

then you'd run regular ajax to call/read the output from a php file....  you'd probably be best @ taking the results and putting them in a delimited form such as:

 

name:address:city:state:zip:grade:gpa etc..

 

then in javascript exploding that into an array and using document.getElementByID(id).value = to set each individual value...

 

otherwise you could throw your entire form into a span with an id or a div with an id and using PHP to echo out the entire HTML for the form and then using this inside javascript:

 

document.getElementByID(id).innerHTML = returnText

Link to comment
https://forums.phpfreaks.com/topic/211200-auto-fill-forum/#findComment-1101669
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.