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?
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
Depends on:
Reported: 2011-03-06 14:19 UTC by contributor
Modified: 2011-08-04 05:02 UTC (History)
7 users (show)

See Also:


Description contributor 2011-03-06 14:19:48 UTC

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

Posted from: by
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 :

"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

<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:

"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:

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)
Comment 7 Michael[tm] Smith 2011-08-04 05:02:39 UTC
mass-moved component to LC1