mercredi 1 juillet 2015

Make an ajax call after form checking

I have a form like this:

<form id="update_form_password">
    <label for="text-input">Nouveau mot de passe</label>
    <input type="password" id="customer_new_password" name="customer_new_password" class="form-control">
    <label for="text-input">Répétez le mot de passe</label>
    <input type="paswword" id="customer_repeat_password" name="customer_repeat_password" class="form-control">
    <button type="submit" class="btn btn-primary"> Enregistrer</button>
</form>

I'm using the jQuery validation plugin to check is my forms are correctly filled.

My problem is to submit the form after the check.

So I have actually:

<script>
$('#update_form_password').validate({
    rules: {
        customer_new_password: "required",
        customer_repeat_password: {
            equalTo: "#customer_new_password"
        }
    }
});
</script>

But how to allow the form submitting and then continue my ajax calls ?

Thanks for your help.

Aucun commentaire:

Enregistrer un commentaire