php – Can you use id tag instead of name tag in getting the value of the checkbox?-ThrowExceptions

Exception or error:

I want to use id tag instead of the name tag in getting the value of checked boxes. The reason I want this is because for some reason my check/unchecked button wont work if i have an array on the name.

echo "<td class='a-center'><input type='checkbox' class='flat' name='checkAll' ></td>";

My other option is to have two checkbox, one would be hidden but i cant figure out how to get the values of the hidden checkbox if it was checked.

Any suggestions on what to do?

echo "<td class='a-center'><input type='checkbox' class='flat' name='checkAll' ></td>";
echo "<td class='a-center'><input type='hidden' class='flat' name='checkAll[" .$row["studentid"]. "]' ></td>";
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *