title: Dojo form validation on button click
body: <p>I am using dojo 1.5.  I want a dojo custom validation of textfield on button click(It is not a submit button). 
  I am using "dijit.form.ValidationTextBox". </p>
  
  <p>If we changed button type to submit, dojo validation is working. but if we changes it to button it won't.</p>
  
  <p>You can find test code here : <a href="http://jsfiddle.net/CQ93P/1/" rel="nofollow">sample code</a></p>
  
  <p>Please tell me how we can validate a textbutton on clicking button. </p>
  
  <p>Below is my code : </p>
  
  <pre><code>dojo.require("dojo.parser");    
  dojo.require("dijit.form.Form");    
  dojo.require("dijit.form.Button");
  dojo.require("dijit.form.ValidationTextBox");
  
  
  function validateForm()
  {   
      // Here I want to validate text box. 
  
  }
  
  
  
  &lt;table style="border: 1px solid #9f9f9f;" cellspacing="10"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="name"&gt;Name:&lt;/label&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type="text" id="name" name="name" required="true" data-dojo-type="dijit/form/ValidationTextBox"   /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="dob"&gt;Date of birth:&lt;/label&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type="text" id="dob" name="dob" data-dojo-type="dijit/form/DateTextBox"/&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;button data-dojo-type="dijit/form/Button" type="button" onClick="return validateForm()"&gt;Validate Form&lt;/button&gt;
  </code></pre>