sheryprince Posted September 16, 2011 Share Posted September 16, 2011 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 https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/ Share on other sites More sharing options...
voip03 Posted September 16, 2011 Share Posted September 16, 2011 You need a AJAX Link to comment https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269844 Share on other sites More sharing options...
sheryprince Posted September 16, 2011 Author Share Posted September 16, 2011 You need a AJAX Thankyou for the reply! Can you plz guide me a little more.............. Please! Link to comment https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269846 Share on other sites More sharing options...
WebStyles Posted September 16, 2011 Share Posted September 16, 2011 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 https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269874 Share on other sites More sharing options...
voip03 Posted September 16, 2011 Share Posted September 16, 2011 For your reading http://roshanbh.com.np/2007/12/change-dropdown-list-options-values-from-database-with-ajax-and-php.html Link to comment https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269941 Share on other sites More sharing options...
sheryprince Posted September 16, 2011 Author Share Posted September 16, 2011 Solved: Thank you Guyz... Thanks alot ... finally i was able to figure it out. Thakyou! Link to comment https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269996 Share on other sites More sharing options...
voip03 Posted September 16, 2011 Share Posted September 16, 2011 That Good. Please make it solved. Link to comment https://forums.phpfreaks.com/topic/247259-multiple-drop-down-lists-via-php-mysql/#findComment-1269998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.