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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.