HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/3817

File a bug

SVNBugCommentTime (UTC)
3817required='' example2009-09-13 07:34
Index: source
===================================================================
--- source	(revision 3816)
+++ source	(revision 3817)
@@ -38765,8 +38765,31 @@
 
   </div>
 
+  <div class="example">
 
+   <p>The following form has two required fields, one for an e-mail
+   address and one for a password. It also has a third field that is
+   only considerd valid if the user types the same password in the
+   password field and this third field.</p>
 
+   <pre>&lt;h1>Create new account&lt;/h1>
+&lt;form action="/newaccount" method=post>
+ &lt;p>
+  &lt;label for="username">E-mail address:&lt;/label>
+  &lt;input id="username" type=email required name=un>
+ &lt;p>
+  &lt;label for="password1">Password:&lt;/label>
+  &lt;input id="password1" type=password required name=up>
+ &lt;p>
+  &lt;label for="password2">Confirm password:&lt;/label>
+  &lt;input id="password2" type=password onforminput="setCustomValidity(value != password1.value ? 'Passwords do not match.' : '')">
+ &lt;p>
+  &lt;input type=submit value="Create account">
+&lt;/form></pre>
+
+  </div>
+
+
   <h6>The <code title="attr-input-multiple">multiple</code> attribute</h6>
 
   <p>The <dfn title="attr-input-multiple"><code>multiple</code></dfn>

|