<input type="checkbox" class="largecheckbox" name="chk_wms[]" value="m1" />
<input type="checkbox" class="largecheckbox" name="chk_wms[]" value="m2" />
<input type="checkbox" class="largecheckbox" name="chk_wms[]" value="m3" />
<input type="checkbox" class="largecheckbox" name="chk_wms[]" value="m4" />
How can I disable m1 and m3?
I tried:
J("input:checkbox[name=chk_wms[value='m1']]").attr("disabled", true);
And I would like to combine the command in one jQuery call something like:
J("input:checkbox[name=chk_wms[value='m1']], input:checkbox[name=chk_wms[value='m3']] ").attr("disabled", true);
The problem is your attribute selector is incorrect. You’ve nested the attribute selector when really you need to make them siblings. Additionally you need to escape the
[]in the name of the checkbox. Try the followingFiddle: http://jsfiddle.net/xMwMQ/