How To Display A Dropdown Select Based On The Value Of Other Dropdown Select?
Suppose I have a dropdown select option like below:
Solution 1:
$('select[name="option"]').change(function(){
$('.hidden').hide();
if(this.value == 1){
$('select[name="name"]').toggle();
}
else if(this.value == 2){
$('select[name="class"]').toggle();
}
});
Solution 2:
Give this a shot:
$(function(){
$("select[name='option']").change(function(e){
if ($(this).val() == "1")
$("select[name='name']").show();
});
});
Post a Comment for "How To Display A Dropdown Select Based On The Value Of Other Dropdown Select?"