I have a list of checkboxes where several checkboxes (in different sub-sections of the list) have identical label text.
When a user selects a checkbox, all other checkboxes with the same label should be automatically selected.
Example:
Hat colors:
Red*
Blue
Green*
Coat colors:
Pink
Green*
Shoe colors:
Red*
Green*
checking any one 'Green' should cause the other two items with label 'Green' to be automatically selected
According to this, http://stackoverflow.com/questions/10124829/select-checkbox-by-label-tex... I can find the checkbox whose label contains a given text using :contains
As it happens, this is a taxonomy vocab. in which every item which appears more than once has a asterisk at the end of its name, as the name appears in the label text.
I am asking for help on how to read the label text from each manually checked item into a variable, then use that variable to cause all that other items of that page with the same label text to be automatically selected; and to do so without creating a loop.
Comments
Example.
Hey John,
Below is the sample working example of same.
This might not be the exact thing you require, but this will surely help you.
HTML
jQuery
Many thanks for that. I will
Many thanks for that. I will go and try it very soon.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Thanks for getting me started
Thanks for getting me started. This is what I got working.
--EDIT--
Simplified version, for getting and checking checkboxes where two have the same label text.
Problem is I have not worked out how to untick the boxes on second click using this method.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Great !
Glad to help you :)