Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The closest thing I've found is in the article <a href="https://web.archive.org/web/20130919030425/http://denverdeveloper.wordpress.com/2012/09/26/some-things-ive-learned-about-jquery-unobtrusive-validation/" rel="noreferrer">Some things I’ve learned about jQuery unobtrusive validation</a>. The article has better formatting and more info, but I've copied the good parts here in case it disappears.</p> <ul> <li><code>data-val="true"</code>: enable unobtrusive validation on this element (should be on every input element you want to validate)</li> <li><code>data-val-required="ErrMsg"</code>: makes the input required, and shows the ErrMsg</li> <li><code>data-val-length="ErrMsg"</code>, <code>data-val-length-min="5"</code>, <code>data-val-length-max="15"</code>: sets required string length and associated error message.</li> <li><code>data-val-number="ErrMsg"</code>: makes a field required to be a number.</li> <li><code>data-val-date="ErrMsg"</code>: requires a field to be a date (I do not recommend this, as it accepts too much – I prefer to use regex).</li> <li><code>data-val-equalto="ErrMsg"</code>, <code>data-val-equalto-other="Fld"</code>: requires one field to match the other (such as password confirm. Fld is a jQuery selector</li> <li><code>data-val-regex="ErrMsg"</code>, <code>data-val-regex-pattern="^regex$"</code>: Requires the field to match the regex pattern.</li> <li><code>data-val-email="ErrMsg"</code>: requires a field to be a email (I do not recommend this, as it accepts too much – I prefer to use regex).</li> <li><code>data-val-url="ErrMsg"</code>: requires a field to be a url (I do not recommend this, as it accepts too much – I prefer to use regex).</li> </ul> <hr> <p><strong>Update:</strong></p> <p>For displaying the validation message, add a container for each control you want to validate.</p> <pre><code>&lt;div class="field-validation-valid" data-valmsg-for="controlName" data-valmsg-replace="true"&gt;&lt;/div&gt; </code></pre> <p>Note that <code>data-valmsg-for</code> is the control's <strong>name</strong>, not id.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload