Looking for a little help with a javascript query...
I have a list of values (in a form field).
I have a list of checkboxes on the screen.
I want to be able to pre-set those checkboxes whose value is contained in the hidden list of values when I press a button.
I can read the list of values from the field and convert to an array using split.
I want to be able to loop over the checkboxes and set them checked if their value is in the array. Can I do this without looping over the values of the array each checkbox iteration?
Straight JS, no frameworks...
Cheers...
I have a list of values (in a form field).
I have a list of checkboxes on the screen.
I want to be able to pre-set those checkboxes whose value is contained in the hidden list of values when I press a button.
I can read the list of values from the field and convert to an array using split.
I want to be able to loop over the checkboxes and set them checked if their value is in the array. Can I do this without looping over the values of the array each checkbox iteration?
Straight JS, no frameworks...
Cheers...