I have three checkboxes like ch[0], ch[1] and ch[3] (sometimes i have more, or less, it’s dinamic) and in PHP i want to get the unselected items also, like this: 0=yes,1=no,3=yes and so on.
Can I solve this somehow?
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.
A common way is to put a hidden form field beside the checkbox and then via javascript set the value for that when the checkbox is changed.
EDIT: You don’t need javascript. But the hidden field is a way to go, when you don’t neccessarily know, on the page that is posted to, how many checkboxes there are on the requesting page. Check out: http://www.felgall.com/xtutf06a.htm