I'm trying to validate a form without submitting it. What I've done so far works well. The problem is when the autocomplete browser completes the login and password that have been saved to the IP. If I delete the auto-completed field and give focusOut the event to validate form is not triggered.
I'm using the following:
jquery -validation - 1.15.0
google-chrome version 49.0.2623.87 (64-bit)
Steps:
1 - Create a form and submit this form.
2 - Make browser save this information as the default values for that site.
3 - Go back to the form and delete an "automatically filled" field and try to trigger some event for jquey-validate to validate.
It should validate the field without the need to submit. In my case you are not triggering the event and validation is not occurring.
form
<form name="form" id="loginform" class="lm-login-form" method="post" action="./?_task=login">
<div id="userid" class="lm-login-item">
<div class="lm-login-label">
<label for="rcmloginuser"><roundcube:label name="mail" /></label>
</div>
<div class="lm-login-field">
<input name="_user" id="rcmloginuser">
</div>
</div>
<div id="pwdid" class="lm-login-item">
<div class="lm-login-label">
<label for="rcmloginpwd"><roundcube:label name="password" /></label>
</div>
<div class="lm-login-field">
<input name="_pass" id="rcmloginpwd" type="password">
<a href="#" id="showpass">Exibir</a>
</div>
</div>
<p class="formbuttons">
<input type="submit" id="submitloginform" class="lm-login-submit" value="Entrar">
</p>
</form>
Validation script
$(document).ready(function() {
$( '#loginform' ).validate({
rules: {
_user: {
required: true,
email: true
},
_pass: {
required: true
}
},
});
});