我有一个 php web 表单,当用户选择一个单选按钮时,我希望下拉列表中只有某些选项可用。例如,如果我从我的广播组中选择House,我只希望用户在下拉列表中看到House1、House2和House 3选项。
这可能使用jquery吗?如果是这样,我将如何编码?
jsFiddle在这里:http: //jsfiddle.net/justmelat/kkk7J/
html在这里:
<form method="post">
<fieldset id="Group1" name="Group1">
<legend>Group box</legend>
<input id="Radio1" name="Radio1" type="radio" value="House" />House<br />
<input id="Radio1" name="Radio1" type="radio" value="Condo" />Condo<br />
<input id="Radio1" name="Radio1" type="radio" value="Boat" />Boat<br />
</fieldset><br/><br/>
<fieldset id="Group2" name="Group2">
<legend>Group Options</legend>
<select id="Select1" name="Select1">
<option value="HO-House 1">House 1</option>
<option value="HO-House 2">House 2</option>
<option value="HO-House 3">House 3</option>
<option value="CO-Condo 1">Condo 1</option>
<option value="CO-Condo 2">Condo 2</option>
<option value="CO-Condo 3">Condo 3</option>
<option value="BO-Boat 1">Boat 1</option>
<option value="BO-Boat 2">Boat 2</option>
<option value="BO-Boat 3">Boat 3</option>
</select></fieldset></form>
先感谢您。