根据另一个选择框选择JQuery隐藏选择框的选项

时间:2014-04-12 22:38:50

标签: javascript jquery html drop-down-menu

我设置了不同的选择框,例如

"course 1" (with dates - May 01, June 01), 
"course 2 (with dates - June 01, August 01)" 
"course 3 (with dates - July 01, June 01)". 

所以要求是如果用户选择"Course 1" and select "date - June 1",然后如果用户选择"Course 2" or "course 3",那么我必须将用户无法选择日期的逻辑放在"June 1 for course 2""course 3"因为用户已为"June 1"选择了"Course 1"。因此,用户只能为"August 01"选择"Course 2",为"July 01"选择"Course 3"

请参阅html代码

<select class="c1"><option value="May 01">May 01</option><option value="June 01">June 01</option></select>
<select class="c2"><option value="June 01">June 01</option><option value="Aug 01">Aug 01</option></select>
<select class="c3"><option value="June 01">June 01</option><option value="July 01">July 01</option></select>

那么有没有办法用JQuery实现呢?

0 个答案:

没有答案