i have many check boxes all named features, with different values, how do i collect their values in php and whats the best method to save an repopulate the form when its loaded, so tha it will show previously selected values.
thanks
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.
Checkboxes are are generated like this:
So you will output them with a code similar to this:
To redisplay, you will need to prepare the appropriare variables, according to user’s post. You could put all of them in an array, and cycle upon it to generate them all.
Some tricks with checkboxes:
<input type='checkbox' name='options[check1]' value="1" /> Unchecked checkbox <input type='checkbox' name='options[check2]' value="1" /> Unchecked checkboxyou will get an array called $_POST[‘options’] in your POST, with check1 and check2 as your keys.