I have 2 drop down in the jsp page. The first drop down is dynamically populated
The second drop down will be populated depending on the selection in the first one.
The second drop down title should be Select XXX Type where XXX is the value selected in the first drop down I am having the id of the first selected drop down and i am sending the id to the Action Class
This one of our most asked question. Search this, and the HTML forum (Google too) with keywords: "Dependent dropdown" or "cascading dropdown" and you will find plenty of discussion on the subject.
Also this example does not account for the fact that the values in the secondary dropdown depend upon the selected value. [ October 12, 2007: Message edited by: Bear Bibeault ]
Hi, So, your first drop down is being populated by a server call. right. In the Select tag, give the javascript function, like <Select name="firstDropDown" onChange="displaySecondDropDownList()"> <option ..></option> in the javascript function, function displaySeconDropDownList(){ var selectedValue = document.forms[0].firstDropDown.options[selectedIndex].value then take a hidden variable and assign this value to that variable and set in the corresponding form. Then invoke the action class, and get the corresponding second dropdown list values from the database based on this selected value. :-)