HTML5 Input type "number" in Firefox

Viewed 37927

I am working on an app that is only used by a few people in-house, so I feel comfortable telling them to only use Firefox or Chrome, so I can use HTML5.

I was working on a very simple feature:

<style> 
input:invalid { background-color: red; }
div.box {
border-color:#000; 
border-width:thin; 
border-style:solid;
}
</style>     
<input type="number" name="id"> <small>(if the box becomes red, make sure you didn't put a space)</small> 

It works great in Chrome: it becomes red and won't let you submit, without me coding anything else.

Firefox ... not so much. It acts as if I had a "text" type.

Is that a known issue? Workaround?

Thanks

6 Answers

input type="number" is not implemented in Firefox yet as of version 25 (November 2013).

Bug 344616 is the relevant ticket in Bugzilla@Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=344616

Update 10 March 2014 - Good news! Looks like the ticket was fixed in Firefox 29, scheduled for release on 29 April 2014.

Update 30 April 2014 - Confirmed, I just gave it a try, and Firefox 29 has support for input type="number".

Related