jquery select all checkboxes that share same tr id -
i working on jquery check html checkboxes share same id
<span class="idclass"><input type="checkbox" class="idleft" name="selectall" value="wlevel04"> select </span> <td class="left"><input type="checkbox" name="unchecked[]" value="499703"></td> <td class="left"><input type="checkbox" name="unchecked[]" value="855155"></td> <td class="left"><input type="checkbox" name="unchecked[]" value="234203"></td> <td class="left"><input type="checkbox" name="unchecked[]" value="489741"></td>
here jquery
$(".idleft").live('click', function () { var id = $(this).val(); $(this).attr('tr').val(id).find(':checkbox').attr('checked', this.checked); });
i believe you're looking for:
fiddle: http://jsfiddle.net/tymejv/3gkt3/
jq:
$(".idleft").change(function() { if (this.checked) { $("input[name^='unchecked']").each(function() { $(this).prop("checked", true); }); } else { $("input[name^='unchecked']").each(function() { $(this).prop("checked", false); }); } });
Comments
Post a Comment