Hi,
How do I go about select a "unknown" number of checkboxes ?
What I mean by unknown is that the number of checkboxes get determined from the amount of records which are returned from the database. The checkboxes all have the same name but their value is "Dynamicaly" created.
I need a script which will select from 1 box to however many records are returned. The script also has to be able to clear the boxes via the same link.
i.e: Say I have 20 boxes all named "myData", if I was to click on the link "ALL", then all the boxes would get selected. If I was to click the link again, then all the boxes would be cleared. If only SOME of the boxes are selected then the link should CLEAR all the boxes.
If someone could write me a quick script which would enable me to do this, then that would be great, as I am not a great JS programmer.
Thanks alot in advance.
How do I go about select a "unknown" number of checkboxes ?
What I mean by unknown is that the number of checkboxes get determined from the amount of records which are returned from the database. The checkboxes all have the same name but their value is "Dynamicaly" created.
I need a script which will select from 1 box to however many records are returned. The script also has to be able to clear the boxes via the same link.
i.e: Say I have 20 boxes all named "myData", if I was to click on the link "ALL", then all the boxes would get selected. If I was to click the link again, then all the boxes would be cleared. If only SOME of the boxes are selected then the link should CLEAR all the boxes.
If someone could write me a quick script which would enable me to do this, then that would be great, as I am not a great JS programmer.
Thanks alot in advance.