function changeDDL2(projectNameSelected) {
var projectId = document.getElementById(projectNameSelected);
var projectName = projectId.options[projectId.selectedIndex].text;
var xreq;
if (window.XMLHttpRequest) {
xreq = new XMLHttpRequest();
} else {
xreq = new ActiveXObject("Microsoft.XMLHTTP");
}
xreq.onreadystatechange = function() {
if ((xreq.readyState == 4) && (xreq.status == 200)) {
if (xreq.responseText == "") {

} else {
document.getElementById("DDL1").innerHTML = xreq.responseText;
}
}
}
xreq.open("POST"," ", true);
xreq.send( "projectName="+projectName+"&DDLid="+DDL1);
}


I have an interface that has 4 dropdownlists and each dropdownlist is generated choosing its value from its prceding dropdownlists .
How can i do it. plz help . The first DDL fetches value from the database and the 2nd DDL is generated when an option is chosen in 1st DDL.
Thanks in adv.
Ihave to do it using java and servlets(JS,AJAX or Jquery can be used).