I currently have the following table:
Checkbox (ID) | Training Course Code | Training Course Name | ....
[ ] | DE00155115-1 | H&S Exec 1 | ....
[ ] | DE00155115-1 | H&S Exec 1 | ....
[ ] | DE00074454-2 | H&S Exec 2 | ....
Each course runs more than once but can only be selected once hence the multiple IDs per course code.
What I want to do is be able to disable / highlight the duplicate rows once one has been selected.
In the above example if the first row was selected, the second would disable and vice versa. If the third row was selected nothing would happen.
I have attempted several functions using jQuery but not really sure where to start and build from.
Here’s a long, and slightly involved, option:
JS Fiddle demo.
References:
addClass().:checkboxselector.:checkedselector.closest().each().find().is().next().not().:nth-child()selector.on().parent().prop().removeClass().text().