August 20, 2010
Parent child combo box
Question by user395702
Hi
I want to implement child parent combo box(country state like if we select any country the state combo box should be populated according to selected country) in my form with jquery.
Please give any suggestion how to implement this
Thanks
Answer by Starx
Well, attach a function on the change event of the country combo box and fetch the html from the AJAX or similar. Then populate the child combo box.
For example
$("#parentbox").change(function() {
var myval =$("#parentbox").val();
// Fetch the content from database or similar
$("#childbox").html(newhtml);
}