Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Validate Plugin doesn't work
    primarykey
    data
    text
    <p>I'm using jQuery and jQuery Validate Plugin on a test page, my code is based on <a href="http://jquery.bassistance.de/validate/demo/" rel="nofollow" title="jQuery Validate Demo">validate demo</a></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://jquery.bassistance.de/validate/lib/jquery-1.9.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="scripts/jquery.validate.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $.validator.setDefaults({ submitHandler: function() { alert("submited!!!"); } }); $().ready(function() { $("#registerForm").validate({ rules : { username: { required: true, minlength: 2 }, password: { required: true, minlenght: 5 }, confirm_password: { required: true, minlenght: 5, equalTo: "#password" }, email: { required: true, email: true } }, messages : { username: { required: "Please enter a username", minlenght: "Your username must consist at least 2 characters" }, password: { required: "Please enter a password ", minlenght: "Your password must consist at least 5 characters" }, confirm_password: { required: "Please repeat the password", minlenght: "Your password must consist at least 5 characters", equalTo: "This password doesn't match with the original password" }, email: { required: "Please enter a email", email: "Invalid email" } } }); }); &lt;/script&gt; &lt;style type="text/css"&gt; #commentForm { width: 500px; } #commentForm label { width: 250px; } #commentForm label.error, #commentForm input.submit { margin-left: 253px; } #registerForm { width: 670px; } #registerForm label.error { margin-left: 10px; width: auto; display: inline; color: red; } #newsletter_topics label.error { display: none; margin-left: 103px; } &lt;/style&gt; &lt;/head&gt; &lt;body class="zoom: 1;"&gt; &lt;div id="main"&gt; &lt;form id="registerForm" method="post" action="" novalidate="novalidate"&gt; &lt;fieldset&gt; &lt;legend&gt;OLA MUNDO&lt;/legend&gt; &lt;p&gt;&lt;label for="username"&gt;Nome&lt;/label&gt; &lt;input id="username" name="username" type="text" value=""&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="email"&gt;E-mail&lt;/label&gt; &lt;input id="email" name="email" type="email" value=""&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="password"&gt;Password&lt;/label&gt; &lt;input id="password" name="password" type="password" value=""&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="confirm_password"&gt;Confirm Password&lt;/label&gt; &lt;input id="confirm_password" name="confirm_password" type="password" value=""&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="submit" class="submit" value="Enviar"&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/body&gt; </code></pre> <p> </p> <p>The problem is that in my page the code doesn't work and i don't know why it happens.</p> <p>I have a jquery.js file in my scripts directory but the script isn't loaded. So i used the jquery from the demo site, i used the jquery hosted on google and that doesn't solves the problem. I don't know if the problem is on the script code, because i'm kind of newbie on javascript.</p> <p>@Edit</p> <p>I solved the problem but now the password and confirm password field doesn't validate, why? the js code is correct</p>
    singulars
    1. This table or related slice is empty.
    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. 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