HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
3820step/min/max examples.2009-09-13 07:50
@@ -38993,20 +38993,38 @@ You cannot complete this form until the field is correct.</samp></pre>
 
   <p class="note">If an element has a <span
   title="attr-input-max">maximum</span> that is less than its <span
   title="attr-input-min">minimum</span>, then so long as the element
   has a <span title="concept-fe-value">value</span>, it will either be
   <span>suffering from an underflow</span> or <span>suffering from an
   overflow</span>.</p>
 
   </div>
 
+  <div class="example">
+
+   <p>The following date control limits input to dates that are before
+   the start of the 21st century:</p>
+
+   <pre>&lt;input name=bday type=date max="2000-12-31"></pre>
+
+  </div>
+
+  <div class="example">
+
+   <p>The following number control limits input to whole numbers
+   greater than zero:</p>
+
+   <pre>&lt;input name=quantity required type=number min=1 value=1></pre>
+
+  </div>
+
 
   <h6>The <code title="attr-input-step">step</code> attribute</h6>
 
   <p>The <dfn title="attr-input-step"><code>step</code></dfn>
   attribute indicates the granularity that is expected (and required)
   of the <span title="concept-fe-value">value</span>, by limiting the
   allowed values. <span class="impl">The section that defines the
   <code title="attr-input-type">type</code> attribute's current state
   also defines the <dfn title="concept-input-step-default">default
   step</dfn> and the <dfn title="concept-input-step-scale">step scale
@@ -39072,20 +39090,43 @@ You cannot complete this form until the field is correct.</samp></pre>
   title="concept-input-value-string-number">algorithm to convert a
   string to a number</span> to the string given by the element's <span
   title="concept-fe-value">value</span> is a number, and that
   number subtracted from the <span title="concept-input-min-zero">step
   base</span> is not an integral multiple of the <span
   title="concept-input-step">allowed value step</span>, the element is
   <span>suffering from a step mismatch</span>.</p>
 
   </div>
 
+  <div class="example">
+
+   <p>The following range control only accepts values in the range
+   0..1, and allows 256 steps in that range:</p>
+
+   <pre>&lt;input name=opacity type=range min=0 max=1 step=0.00392156863></pre>
+
+  </div>
+
+  <div class="example">
+
+   <p>The following control allows any time in the day to be selected,
+   with any accuracy (e.g. thousandth-of-a-second accuracy or
+   more):</p>
+
+   <pre>&lt;input name=favtime type=time step=any></pre>
+
+   <p>Normally, time controls are limited to an accuracy of one
+   minute.</p>
+
+  </div>
+
+
 
 
   <h6>The <code title="attr-input-placeholder">placeholder</code> attribute</h6>
 
   <!-- similar text in the <textarea> section -->
 
   <p>The <dfn
   title="attr-input-placeholder"><code>placeholder</code></dfn>
   attribute represents a <em>short</em> hint (a word or short phrase)
   intended to aid the user with data entry. A hint could be a sample

|