Skip to content

Commit

Permalink
[e] (0) required='' example
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3817 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 13, 2009
1 parent 9e7c8c6 commit 5da5071
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -34863,6 +34863,29 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H

</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&gt;Create new account&lt;/h1&gt;
&lt;form action="/newaccount" method=post&gt;
&lt;p&gt;
&lt;label for="username"&gt;E-mail address:&lt;/label&gt;
&lt;input id="username" type=email required name=un&gt;
&lt;p&gt;
&lt;label for="password1"&gt;Password:&lt;/label&gt;
&lt;input id="password1" type=password required name=up&gt;
&lt;p&gt;
&lt;label for="password2"&gt;Confirm password:&lt;/label&gt;
&lt;input id="password2" type=password onforminput="setCustomValidity(value != password1.value ? 'Passwords do not match.' : '')"&gt;
&lt;p&gt;
&lt;input type=submit value="Create account"&gt;
&lt;/form&gt;</pre>

</div>


<h6 id=the-multiple-attribute><span class=secno>4.10.4.2.6 </span>The <code title=attr-input-multiple><a href=#attr-input-multiple>multiple</a></code> attribute</h6>
Expand Down
23 changes: 23 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -38765,6 +38765,29 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {

</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>
Expand Down

0 comments on commit 5da5071

Please sign in to comment.