alicefreak Posted August 19, 2010 Share Posted August 19, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/211200-auto-fill-forum/ Share on other sites More sharing options...
radar Posted August 20, 2010 Share Posted August 20, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/211200-auto-fill-forum/#findComment-1101669 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.