This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23124 - input type="checkbox" should always provide value for GET, POST, consistency
Summary: input type="checkbox" should always provide value for GET, POST, consistency
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 enhancement
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-02 08:20 UTC by Jim Michaels
Modified: 2013-09-03 11:20 UTC (History)
4 users (show)

See Also:


Attachments

Description Jim Michaels 2013-09-02 08:20:11 UTC
currently, <input type="checkbox" name="ienableTax" checked> gives the value ienableTax=on in the URL.
if it's not checked, nothing is put in the URL for GET.

expected: I think it should always give a value in URL no matter the state. I was thinking of off for a an unchecked value. this would make the values mnemonic, on and off, which also makes it more intuitive ti programmers. 

programmers who are new to the forms controls expect that it should always have a value and are surprised when it doesn't and their programs that they thought would work suddenly break. even in js, .checked always has a value (true, false).

it is difficult to detect the presence of something that's not there.

- this would me a major change. 
- it would break existing working sites. 
- once a change such as this has been put in, it will be easier to develop web sites.
- even in POST, this same problem persists and is causing developers problems in PHP etc with needless posted bug reports around the globe probably. why? checkbox's I/O behavior in GET and POST is inconsistent with the rest of the form controls, which other controls always have a value POSTed/GETted.


use case:
I have http://JesusnJim.com/calculators/finances/calculator-with-estimator-to-save-up-for-item.html

it is a plain DHTML program and uses a function setidvalfromurlargs(); in /geturlargs.js to use the URL arguments to set the id's. (I can do the same with names).
I wanted client-only functionality with support for GET in HTML. and I got it.
however, because the checkbox doesn't exist in the GET arguments (the URL) after a submit if it's unchecked, this function doesn't see anything for that variable so it doesn't know to set anything for that variable.

the function simply does whatever variables are listed in the URL.

I don't have the time to customize and maintain a new function and individualized list of element names for every web page I create. I have about 20-30 calculators, and they are growing.

====
php examples in php documentation at php.net on forms control handling would have to change of course, which would probably be just a new entry in the comments.

if this gets rejected I will understand completely. 
if it gets passed then I will be very happy.
it's a hopeful ask for consistency.
Comment 1 Robin Berjon 2013-09-03 11:20:39 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: none
Rationale: I do understand your desire for consistency, but as you point out this would break existing working sites. That's just not something we can do, even for just causes such as consistency. For better or worse, the current behaviour is here to stay.