Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnBlur - form is valid #730

Open
CaptainMik opened this issue Nov 2, 2018 · 1 comment
Open

OnBlur - form is valid #730

CaptainMik opened this issue Nov 2, 2018 · 1 comment

Comments

@CaptainMik
Copy link

CaptainMik commented Nov 2, 2018

Hi,
is there a callback function that let me do something if the complete form is valid.
I tried to use
$('input').on('validation', function(evt, valid) {
console.log($('#MyFormID').isValid(lang, conf, false)
);});

But I get "too much recursion" as error.
thanks in advance

@CaptainMik
Copy link
Author

OK, found a solution by myself. So if one is interested here it is:
I put the class 'isrequired' to each form element that needs to be validated.
Than in JS

$('.isrequired').blur(function(){
var FormValid = true;
$('#MyFormID').find('.isrequired').each(function(){
$(this).validate(function(isValid, el) {
if (!isValid) FormValid = false;
});
});
console.log(FormValid )
});

@CaptainMik CaptainMik changed the title OnSuccess - form is valid OnBlur - form is valid Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant