title: Password checking in dojo
body: <p>I want to check that two passwords are the same using Dojo.</p>
  
  <p>Here is the HTML I have:</p>
  
  <p><code></p>
  
  <blockquote>
    <p><code>&lt;form id="form" action="." dojoType="dijit.form.Form" /</code>></p>
    
    <p><code>&lt;p</code>>Password: <code>&lt;input type="password"<br>
        name="password1"<br>
        id="password1"<br>
        dojoType="dijit.form.ValidationTextBox"<br>
        required="true"<br>
        invalidMessage="Please type a password" /</code>><code>&lt;/p</code>></p>
    
    <p><code>&lt;p</code>>Confirm:  <code>&lt;input type="password"<br>
        name="password2"<br>
        id="password2"<br>
        dojoType="dijit.form.ValidationTextBox"<br>
        required="true"<br>
        invalidMessage="This password doesn't match your first password" /</code>><code>&lt;/p</code>></p>
    
    <p><code>&lt;div dojoType="dijit.form.Button" onClick="onSave"</code>>Save<code>&lt;/div</code>></p>
    
    <p><code>&lt;/form</code>>
    </code></p>
  </blockquote>
  
  <p>Here is the JavaScript I have so far:</p>
  
  <blockquote>
    <p><code>
    var onSave = function() {<br>
        if(dijit.byId('form').validate()) { alert('Good form'); }<br>
        else { alert('Bad form'); }<br>
    }
    </code></p>
  </blockquote>
  
  <p>Thanks for your help. I could do this in pure JavaScript, but I'm trying to find the Dojo way of doing it.</p>