Do you guys know when you submit a form via PHP, is the form checkbox value being treated as the string “true” or boolean true? Assuming my checkbox value attribute was set to “true”.
Share
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.
When you submit a checkbox, the value will be whatever you set the value attribute as, and will be a string when PHP parses the form data and populates
$_REQUESTand friends.If you don’t specify a value in the form, then browsers default to
"on", not"true"(this is being made standard behaviour in HTML 5).