Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Validation Plugin Not Recognizing Valid Input
    primarykey
    data
    text
    <p>Not sure what I'm doing wrong. I'm using the <a href="http://docs.jquery.com/Plugins/Validation" rel="nofollow">jQuery Validation</a> plugin. This is my jQuery code:</p> <pre><code>$('#form-login').validate({ onsubmit: true, onfocusout: false, errorClass: 'invalid', wrapper: 'li', errorLabelContainer: '#login-error-list ul', errorContainer: '#login-error-list', highlight: function(element, errorClass) { $(element).addClass(errorClass); $(element.form).find('label[for=' + element.id + ']') .addClass(errorClass); }, unhighlight: function(element, errorClass) { $(element).removeClass(errorClass); $(element.form).find('label[for=' + element.id + ']') .removeClass(errorClass); }, rules: { username: 'required', password: 'required' }, messages: { username: 'Please enter your username.', password: 'Please enter your password.' } }); </code></pre> <p>I followed the API Documentation very closely while writing this. However, no matter what input is entered (whether it's none, or anything valid), it still throws an error as if the username and/or password were never entered in. You can see for yourself on <a href="http://www.wowgeeks.com/login.php" rel="nofollow">this login page</a>.</p> <p>Anyone know what the problem could be?</p> <p>P.S.: I should add the HTML code that generates the form and error container:</p> <pre><code>&lt;p&gt;Already have an account with us? Then log in!&lt;/p&gt; &lt;form action="login.php" method="post" id="form-login"&gt; &lt;input type="hidden" name="success_page" value="" /&gt; &lt;div class="group"&gt; &lt;label for="username"&gt;Username:&lt;/label&gt; &lt;input type="text" name="username" id="username" title="Username" maxlength="20" min="6" max="20" /&gt; &lt;/div&gt; &lt;div class="group"&gt; &lt;label for="password"&gt;Password:&lt;/label&gt; &lt;input type="password" name="password" id="password" title="Password" min="6" /&gt; &lt;/div&gt; &lt;div id="login-error-list" class="group" style="display: none;"&gt; &lt;p&gt;Errors:&lt;/p&gt; &lt;ul&gt;&lt;/ul&gt; &lt;/div&gt; </code></pre>
    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