Requirement:
Filter drop down list options based on another drop down selection.
Sample code:
$("Select[title$='dropdown1']").change(function(){
var val=$(this).val();
if(val=="Fruits"){
$("Select[title$='dropdown2']".html("<option value='Apple'>Apple</option><option value='Orange'>Orange</option>");
}
else if(val=="Vegetables"){
$("Select[title$='dropdown2']".html("<option value='Onion'>Onion</option><option value='Tomato'>Tomato</option>");
}
});
Filter drop down list options based on another drop down selection.
Sample code:
$("Select[title$='dropdown1']").change(function(){
var val=$(this).val();
if(val=="Fruits"){
$("Select[title$='dropdown2']".html("<option value='Apple'>Apple</option><option value='Orange'>Orange</option>");
}
else if(val=="Vegetables"){
$("Select[title$='dropdown2']".html("<option value='Onion'>Onion</option><option value='Tomato'>Tomato</option>");
}
});
Comments
Post a Comment