好的,所以我有一些 javascript 在开始时禁用了洒单选按钮。如果您选择结冰,则应启用洒水。如果选择了“无”结冰单选,则取消选择并禁用所有结冰单选按钮。
到目前为止,我有:
function SetSprinklesEnabled()
{
if (document.getElementById("White").enabled)
{
document.getElementById("HundredsAndThousands").enabled;
}
}
和
<b>Icing Flavours (Regular - 50c | Large - 70c):</b><br>
<INPUT TYPE="Radio" Name="Icing1" id="White" onblur="SetSprinklesEnabled()">White
<INPUT TYPE="Radio" Name="Icing2" id="Pink">Pink
<INPUT TYPE="Radio" Name="Icing3" id="Blue">Blue
<INPUT TYPE="Radio" Name="Icing4" id="Yellow">Yellow
<INPUT TYPE="Radio" Name="Icing5" id="Green">Green
<INPUT TYPE="Radio" Name="Icing6" id="None">None
<br><br>
<b>Sprinkles (50c):</b><br>
<INPUT TYPE="Radio" Name="Sprinkles1" id="HundredsAndThousands" disabled> Hundreds & Thousands
<INPUT TYPE="Radio" Name="Sprinkles2" id="ChocolateSprinkles" disabled>Chocolate Sprinkles
<INPUT TYPE="Radio" Name="Sprinkles3" id="SilverBalls" disabled >Silver Balls
<INPUT TYPE="Radio" Name="Sprinkles4" id="Coconut" disabled>Coconut
<INPUT type="button" value="Remove Sprinkles" onclick="RemoveSprinkles()" >
<br> <br> <br>
这是检查它的 JFiddle:http: //jsfiddle.net/UTtxA/39/