Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Event trigger for the whole form Validated #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Event trigger for the whole form Validated #120

wants to merge 2 commits into from

Conversation

macedd
Copy link

@macedd macedd commented Apr 28, 2015

It is not possible to determine when the form was fully validated.
This simple patch manage to trigger an event after all fields are validated.

fix #69 and closes #116

@macedd
Copy link
Author

macedd commented May 19, 2015

Trigger events is what validate do. #116 (comment)
This is an async approach, and a reliable way to look for errors in a form, programmatically, is simple to achieve with jquery's when

@macedd
Copy link
Author

macedd commented May 19, 2015

Example Usage

$('.form-element').on('form.validated.bs.validator', function() {
    var validator = $(this).data('bs.validator');
    if (!validator.hasErrors())
     console.log('No errors found');
    else
     console.log('Some errors present');
});

@ferrod20
Copy link

ferrod20 commented Sep 8, 2015

This looks great @ThiagoF.
Exactly what I was looking for.

Thank you very much.

@devgnx
Copy link

devgnx commented Sep 5, 2017

I'm becoming crazy about these race conditions on each input validation.
I need this.

@1000hz, Please...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to synchronously tell form is valid from js Response from .validator('validate')
3 participants