troubleshooting Question

Checkbox form data relating to server side scripts

Avatar of Rob
RobFlag for Australia asked on
Web Languages and StandardsPHP.NET Programming
38 Comments1 Solution849 ViewsLast Modified:
I wanted to find out what's going on with how checkboxes are submitted as form data as it seems that there is a difference between server side scripts.

This question was spurned from https://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_28226128.html#a39457253

This link: http://www.w3.org/TR/html401/interact/forms.html#checkbox
states:
Several checkboxes in a form may share the same control name. Thus, for example, checkboxes allow users to select several values for the same property. The INPUT element is used to create a checkbox control.

But it also says under the section "Successful Controls" http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2
All "on" checkboxes may be successful.
Now what does that mean??

It doesn't seem to be the case for PHP, where only the last checkbox's value with the same name is received : http://phpfiddle.org/main/code/td9-usz

But it is the case for coldfusion. (see referring link to the other question above), this involves submitting form data to coldfusion that will handle checkboxes with the same name (without [ ]) and compile them into a comma delimited string when the form is submitted.

So my question(s) are:
Is PHP doing what it should and am I missing something in my phpfiddle example?
How does .NET applications (and other server based technologies) handle the same form data and do they require the array indicators [ ]?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 38 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 38 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros