Is it alright if I put the cat[] array value in the for, name and id attributes.
code.
<label for="cat[]">' . $cat['category'] . '</label>
<input type="checkbox" name="cat[]" id="cat[]" value="' . $cat['id'] . '" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short Answer: No.
Long Answer
No because:
cat[]. However, the id attribute must be unique. Therefore, you can’t have the id and name equal. If you don’t have a decent unique id for each checkbox then just increment cat. So the first checkbox would have an id ofcat1, the second an id ofcat2and so on.