Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Validate Plugin not validating metadata
    primarykey
    data
    text
    <p>I've got a basic form setup for user input (first name, last name, email). I've got jQuery and the validation plugin imported properly. My configuration for the validation is this:</p> <pre><code>$(document).ready(function() { $("#form").validate({meta: "validate"}); }); </code></pre> <p>According to the documentation for the plugin that can be found <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">here</a> and <a href="http://docs.jquery.com/Plugins/Validation">here</a>, this should mean I can add specifics to each input I want to validate. Thusly, I have this:</p> <pre><code>&lt;input type="text" name="fn" value="" class="required" title="Please enter your first name." id="fn0"&gt; &lt;input type="text" name="ln" value="" class="required" title="Please enter your last name." id="ln1"&gt; &lt;input type="text" name="em" value="" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address.', email:'Please enter a valid email address.'}}}" id="em2"&gt; </code></pre> <p>Each of these has it's own label that I've omitted.</p> <p>My CSS is setup like this:</p> <pre><code>label.error { color: red; font-weight: bold; } </code></pre> <p>When on the form after clicking submit with all three fields blank, First Name and Last name show the red error messages as expected (<code>Please enter your first name.</code> and <code>Please enter your last name.</code> respectively. However, no error messages come up for the Email. If I put an invalid-formatted email address, I still receive no message. I've googled for a while and have read over the documentation, but I can't seem to pinpoint where this might be failing.</p> <p>Thanks</p> <p><strong>Note:</strong> IDs and Names have been editied for simplicity from my source code.</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.
 

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