I have a basic form with a jquery validation bound to it.
HTML :
<form id="form-subscribe" method="post">
<div class="register_pane_content">
<label>Nom</label>
<input placeholder="Votre nom" type="text" id="lastname" name="lastname" value="" class=""/>
</div>
<div class="register_pane_content">
<label>Prénom</label>
<input placeholder="Votre prénom" type="text" id="firstname" name="firstname" value="" class=""/>
</div>
<div class="register_pane_content ">
<label>E-mail</label>
<input placeholder="Votre e-mail" type="text" id="email" name="email" value="" class=""/>
</div>
<div class="clear"> </div>
<div class="register_pane_content ">
<label>Confirmation e-mail</label>
<input placeholder="Votre e-mail" type="text" id="emailConfirm" name="emailConfirm" value="" class=""/>
</div>
<div class="register_pane_content">
<input class="nh_evoButton" type="submit" value="Valider" />
</div>
</form>
jQuery Validation :
// Validation du formulaire principal
$('#form-subscribe').validate({
onkeyup: false,
onfocusout: false,
onsubmit: true,
rules: {
"lastname": {
required: true
},
"firstname": {
required: true
},
"email": {
required: true,
email: true
},
"emailConfirm": {
required: true,
equalTo: '#email'
},
"phone": {
number: true,
minlength: 10
}
}
});
I don't want any validation until the user submit the form for the first time. That's why I set onkeyup and onfocusout to false. But when the submit validation is triggered once, I'd like the next validations to be triggered on keyup..
Is it possible to customize jquery validation plugin this way ?