W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2012

html5/spec Overview.html,1.5647,1.5648

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 07 May 2012 22:13:45 +0000
To: public-html-commits@w3.org
Message-Id: <E1SRWBe-0006Sk-2h@lionel-hutz.w3.org>
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv24815

Modified Files:
Log Message:
example for type=number (whatwg r7091)

Index: Overview.html
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5647
retrieving revision 1.5648
diff -u -d -r1.5647 -r1.5648
--- Overview.html	7 May 2012 22:05:37 -0000	1.5647
+++ Overview.html	7 May 2012 22:13:41 -0000	1.5648
@@ -41032,6 +41032,29 @@
+  <div class="example">
+   <p>Here is an example of using a numeric input control:</p>
+   <pre>&lt;label&gt;How much do you want to charge? $&lt;input type=number min=0 step=0.01 name=price&gt;&lt;/label&gt;</pre>
+  </div>
+  <p class="note">The <code title="">type=number</code> state is not
+  appropriate for input that happens to only consist of numbers but
+  isn't strictly speaking a number. For example, it would be
+  inappropriate for credit card numbers or US postal codes. A simple
+  way of determining whether to use <code title="">type=number</code>
+  is to consider whether it would make sense for the input control to
+  have a spinbox interface (e.g. with "up" and "down" arrows). Getting
+  a credit card number wrong by 1 in the last digit isn't a minor
+  mistake, it's as wrong as getting every digit incorrect. So it would
+  not make sense for the user to select a credit card number using
+  "up" and "down" buttons. When a spinbox interface is not
+  appropriate, <code title="">type=text</code> is probably the right
+  choice (possibly with a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute).</p>
   <h6 id="range-state-type-range"><span class="secno"> </span><dfn title="attr-input-type-range">Range</dfn> state (<code title="">type=range</code>)</h6>
Received on Monday, 7 May 2012 22:13:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 May 2012 22:13:49 GMT