【发布时间】:2011-09-16 17:24:25
【问题描述】:
我有一个包含 3 个下拉列表的表单,我想逐步切换禁用状态。 I want to disable the 2nd and 3rd dropdown initially, when the user selects an option from the 1st, the 2nd is enabled, when the 2nd option is selected I want the 3rd to be enabled.
如何用 jquery 做到这一点?谢谢
代码如下:
<select name="type" id="select1" style="width:200px" onchange="populate(1);">
<option value="" selected="selected">Select Option 1</option>
<option value="first">First</option>
<option value="second">Second</option>
<option value="third">Third</option>
</select>
<br /><br />
<select name="make" id="select2" style="width:200px" onchange="populate(2);"disabled="disabled">
<option value="">Select Option 2</option>
<option value="first2">First</option>
<option value="second2">Second</option>
<option value="third2">Third</option>
</select>
<br /><br />
<select name="model" id="select3" style="width:200px" onchange="Go(this);"disabled="disabled">
<option value="">Select Make</option>
<option value="first3">First</option>
<option value="second3">Second</option>
<option value="third3">Third</option>
【问题讨论】: