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 12256 - <input type=number value=""> should be valid?
Summary: <input type=number value=""> should be valid?
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 14:19 UTC by contributor
Modified: 2011-08-04 05:02 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2011-03-06 14:19:48 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#attr-input-value

Comment:
<input type=number value=""> should be valid?

Posted from: 81.234.240.242 by philip@foolip.org
User agent: Opera/9.80 (X11; Linux i686; U; en) Presto/2.8.115 Version/11.10
Comment 1 Philip Jägenstedt 2011-03-06 14:23:49 UTC
From http://validator.nu/?doc=http%3A%2F%2Fhtml5.org%2Ftools%2Fweb-apps-tracker :

"Error: Bad value  for attribute value on element input: The empty string is not a valid floating point number."

The offending markup:

<input id=from type=number min=1 value="" name=from required>

The reason this was output was the template code in trackerlib.py:

<input id=from type=number min=1 value="%s" name=from required>

Unless there's any harm in allowing value="" here, maybe we should allow it?
Comment 2 Philip Jägenstedt 2011-03-06 14:34:18 UTC
Anne found the relevant part of the spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#number-state

"The value attribute, if specified, must have a value that is a valid floating point number."
Comment 3 Anne 2011-03-07 07:07:00 UTC
This also applies to type=date and several others. I think we should allow the empty string value everywhere.
Comment 4 Jonas Sicking (Not reading bugmail) 2011-03-22 00:32:46 UTC
Agreed. Given that the empty value is a valid value (unless the element is required of course), it seems surprising that the empty attribute value isn't valid.
Comment 5 Ian 'Hixie' Hickson 2011-05-07 19:07:23 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: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 6 contributor 2011-05-07 19:07:39 UTC
Checked in as WHATWG revision r6118.
Check-in comment: Allow controls to be given a missing value explicitly (<input type=number value=''> for instance)
http://html5.org/tools/web-apps-tracker?from=6117&to=6118
Comment 7 Michael[tm] Smith 2011-08-04 05:02:39 UTC
mass-moved component to LC1