I have two select lists -
select 1 options are - Fri, Sat, Sun
select 2 options are - ...various times....
The goal - the day you select (Fri, Sat, Sun) gives a different list of times in the second select
I tried - I used jquery to hide() to hide the options of the second select based on the value of the first select.
PROBLEM - when I select the third option (Sun), the dropdown of second select is only one line, even though there are 6 items available.
Here's my jsfiddle - http://jsfiddle.net/joshuajsmith/VLuFG/
Here's my jquery: (same as in jsfiddle)
$(function(){
$('#review_day_sel').change(function(){
var selectedDay = $("#review_day_sel option:selected").val();
$(".hide-option").hide();
$("."+selectedDay).show();
});
});
Why is this happening? Is hide() / show() the correct way to do this?