Hi All,
I have two combo boxes combo1 and combo2, Combo1 is populated with list of values from database. Upon selecting value in combo1 iam calling javascrpit function which submits form and populates combo2. The problem is since the form is submitted the combo1's selected value is not retained ?, how can I retain the selected value by the user??
Also how can I call two diffrent actions on change diffrent combo boxes ??, any help is appreciated..
I tried this Javascript but this doen't work..
Here is my actual code
I have two combo boxes combo1 and combo2, Combo1 is populated with list of values from database. Upon selecting value in combo1 iam calling javascrpit function which submits form and populates combo2. The problem is since the form is submitted the combo1's selected value is not retained ?, how can I retain the selected value by the user??
Also how can I call two diffrent actions on change diffrent combo boxes ??, any help is appreciated..
I tried this Javascript but this doen't work..
Code:
function populateConditions () {
document.forms[0].action = "/populateConditionTypes";
document.forms[0].submit();
}
function populateConditionValues () {
document.forms[0].action = "/populateConditionValues";
document.forms[0].submit();
}
Here is my actual code
Code:
function populateConditions () {
document.forms[0].submit();
}
function populateConditionValues () {
document.forms[0].submit();
}
<html:select property="protocolsNames" size="1" onchange="populateConditions()">
<%
for(int i=0; i< protocols.length;i++){
out.println("<option value="+ protocols[i].getId()+ " > " + protocols[i].getProtocolName() + "</option>");
}
%>
</html:select>
<html:select property="conditionTypes" size="1" onchange="populateConditionValues()">
<%
if(protocolConditions !=null){
for(int i=0; i< protocolConditions.length;i++){
out.println("<option VALUE = " + protocolConditions[i].getId() + ">" + protocolConditions[i].getName() + "</option>");
}
}
%>
</html:select>