That is close, the item section will be different for each check box.
The table will have three columns that will be populated with check
boxes only.  The header section in the table will have a global select
for each column.   So  if there is a row that has the following


chk_<categoryID>_<itemID>........   each row will share the same
itemID and each column will share the same category id.


header1 = cat1... header2 = cat2.
row1 = item1.... row2 = item2


so we have two rows with two columns.  We'll have four checkboxes that
will look like this.

ckb_cat1_item1        ckb_cat2_item1
ckb_cat1_item2        ckb_cat2_item2


So, if I select the header for category 1, I need to be able to select
ckb_cat1_item1 & ckb_cat1_item2.



Hopefully that makes more sense.


Thanks!







On Mar 25, 11:37 am, MorningZ <morni...@gmail.com> wrote:
> Your description of your HTML isn't very clear, but none the less this
> could work:
>
> $("selector for header checkboxes").click(function() {
>       var chk = this;
>       $("input[id^='" + chk.id + "_item']").each(function()
> { this.checked = chk.checked; });
>
> })
>
> On Mar 25, 12:12 pm, Andy <adharb...@gmail.com> wrote:
>
>
>
> > Hey guys,
>
> > I have a table where the header has check boxes so if you click on
> > that, it will select all of the other checkboxes in that row.   The
> > issue I have, it's not a select all checkboxes, but ones that have a
> > specific naming convention.   Example.  If my header is named
> > ckb_category1 I need to be able to find all checkboxes that are in
> > that column that have naming like ckb_category1_item1.  Then each row
> > following would have a different item id, but keep the category1 the
> > same.   Is there a pattern I can use that would work for this?
>
> > Thanks!- Hide quoted text -
>
> - Show quoted text -

Reply via email to