我想在选中选中时禁用复选框。 谢谢如何把复选框禁用?
<form id="tform" method="post">
Sélectionnez le type de la machine :<br>
<input type="checkbox" id="1" name="g"<?php if ($_POST['g'] == "pc") {echo 'checked="checked"';} ?> value="pc" class="checkbox"> Pc
<input type="checkbox" id="2" name="g"<?php if ($_POST['g'] == "wiiu") {echo 'checked="checked"';} ?> value="wiiu" class="checkbox">Wii U
<input type="checkbox" id="3" name="g"<?php if ($_POST['g'] == "xbox-360") {echo 'checked="checked"';} ?> value="xbox-360" class="checkbox">Xbox-360
<input type="checkbox" id="4" name="g"<?php if ($_POST['g'] == "playstation-4-ps4") {echo 'checked="checked"';} ?> value="playstation-4-ps4" class="checkbox">Ps4
<input type="checkbox" id="5" name="g"<?php if ($_POST['g'] == "playstation-3-ps3") {echo 'checked="checked"';} ?> value="playstation-3-ps3" class="checkbox">Ps3<br>
<input type="checkbox" id="6" name="g"<?php if ($_POST['g'] == "xbox-one") {echo 'checked="checked"';} ?> value="xbox-one" class="checkbox">One
<input type="checkbox" id="7" name="g"<?php if ($_POST['g'] == "nintendo-3ds") {echo 'checked="checked"';} ?> value="nintendo-3ds" class="checkbox">3ds
<input type="checkbox" id="8" name="g"<?php if ($_POST['g'] == "playstation-vita") {echo 'checked="checked"';} ?> value="playstation-vita" class="checkbox">Vita
<input type="checkbox" id="9" name="g"<?php if ($_POST['g'] == "iphone-ipod") {echo 'checked="checked"';} ?> value="iphone-ipod" class="checkbox">Iphone
<input type="checkbox" id="10" name="g"<?php if ($_POST['g'] == "android") {echo 'checked="checked"';} ?> value="android" class="checkbox">Anfroïd
</form>
同样喜欢这样的问题[http://stackoverflow.com/questions/2330209/jquery-checkbox-enable-disable]( http://stackoverflow.com/questions/2330209/jquery-checkbox-enable-disable) – 2014-10-22 09:36:35
@ryannghiem这不是一个重复的问题,因为该问题是专门寻找一个jQuery解决方案 – 2014-10-22 09:38:37
如果你问一个关于JavaScript的问题,请post * HTML *,而不是生成该HTML的PHP脚本。 – 2014-10-22 09:39:08