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

Button action wont validate #17

Open
ambasador opened this issue Aug 22, 2013 · 1 comment
Open

Button action wont validate #17

ambasador opened this issue Aug 22, 2013 · 1 comment

Comments

@ambasador
Copy link

Hi all,

I've a problem with valid element age on click. I want to check first that element age is valid then load loadresults();, i've tried few option but they dont work, anyone knows how to fix it

$('button').click(function () {
loadresults();
});
var age = new LiveValidation('age', {
validMessage: "Message ",
wait: 1000
});
age.add(Validate.Numericality, {
minimum: 18,
maximum: 100,
onlyInteger: true,
notANumberMessage: "Only Numbers"
});
age.add(Validate.Presence, {
failureMessage: "Error"
});

@BrianPMucha
Copy link

I think instead of binding to .click on the button you need to use .submit on the form. LV will stop the submit if validation fails.

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

2 participants