0

私は以下のようなコードを持っています:

$(document).ready(function(){
        $(".trHide input:radio").attr('disabled',true);
     });
 <tr>
      <td><ul type="circle">
          <li>9. Capacité à rendre compte</li>
        </ul></td>
      <td></td>
      <td><input class="validate[required] radio" type="radio" name="number9" value="1" <?php if($value['9.CapasityRendre'] == 1):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number9" type="radio" value="2" <?php if($value['9.CapasityRendre'] == 2):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number9" type="radio" value="3" <?php if($value['9.CapasityRendre'] == 3):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number9" type="radio" value="4" <?php if($value['9.CapasityRendre'] == 4):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number9" type="radio" value="5" <?php if($value['9.CapasityRendre'] == 5):?>checked='checked'<?php endif; ?>></td>
    </tr>
    <tr class="trHide">
      <td><ul type="circle">
          <li>10. Capacité à faire des choix et à prendre des décisions</li>
        </ul></td>
      <td></td>
      <td><input class="validate[required] radio" type="radio" name="number10" value="1"<?php if($value['10.CapaciteFair'] == 1):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number10" type="radio" value="2"<?php if($value['10.CapaciteFair'] == 2):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number10" type="radio" value="3"<?php if($value['10.CapaciteFair'] == 3):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number10" type="radio" value="4"<?php if($value['10.CapaciteFair'] == 4):?>checked='checked'<?php endif; ?>></td>
      <td><input class="validate[required] radio" name="number10" type="radio" value="5"<?php if($value['10.CapaciteFair'] == 5):?>checked='checked'<?php endif; ?>></td>
    </tr>

私は欲しい:

tag のすべてのラジオ ボックスを無効にしたい<tr class="trHide">

問題:

動作しません。どうすれば修正できますか? 誰でも私を助けてください、ありがとう。

4

1 に答える 1

0

次のように、true の代わりに無効にしてみてください。

$(document).ready(function(){
    $(".trHide input:radio").attr('disabled','disabled');
});
于 2012-10-31T04:17:11.987 に答える