Jump to content

Multiple drop down lists via php MySQL


sheryprince

Recommended Posts

Hello Friends!.... here is the big idea. I am trying to make a form in which there will be 2 drop down lists which will be populating directly from MySQL DB ....

Actually i am developing a student management system as my first PHP project... here i want to have 2 drop down lists first is roll number and second is student name. i want that when some one select the roll number in the first drop down the student name against it is automatically populated in the next drop down.

 

 

Plz help me friends i am new to php and dont know soo much.! any help PLZZZZZZZZZZ

Link to comment
Share on other sites

you use javascript to grab the selected name in the first dropdown. you can trigger the javascript function with the element's onchange tag.

You can do a select box with onChange="functionName(this.value);" to send the name, then you use ajax to send that name to a php file that will build the second dropdown and send it back to your javascript, Once you grab the AJAX responseText, you use somthing like this to print the combo onto the page:

document.getElementById("divName").innerHTML = returnedComboBox;

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.