Here is my checkbox group
<input type="checkbox" name="checkGroup" id="all" value="0" >All
<input type="checkbox" name="checkGroup" id="one" value="1">One
<input type="checkbox" name="checkGroup" id="two" value="2">Two
<input type="checkbox" name="checkGroup" id="three" value="3">three
how to get array of checkbox by name “checkGroup” and then base on value set it checked / uncheck.
e.g.
In edit mode i am getting string 012 from database
then i need to set checked as All, One amd Two.
Please help thanks
If you go for this approach, of returning a string of numbers not separated by any character (like “012”), you can only handle without problems up to 10 elements (0-9):
Check an example here.