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
Validate inputs outside form #2184
Comments
I also experience this issue; because of my page layout I would need to put the entire page itself inside a form tag and that majorly screws up my styling for the myriad elements that have nothing to do with the form; I was, therefore, elated to discover I could associate all these form elements outside of a form tag and it would not jack up my styling. If I don't attempt javascript validation and just submit the form it works exactly as if I had all input elements inside of a form tag --- perfect! But... if I attempt to use this validation library, it just submits my form without any validation happening and no errors, even with invalid data. If it place a few inside the form tag surrounding my submit button, then those get triggered for validation. So, it seems kinda misleading to advertise this as a 'form validation library' when it demonstrably is not; it is just and only a validation library for pre-HTML5 forms (since the I banged my head against this for 2 days before I came across this ticket and realized I wasn't the only one having this issue. Time to go look for a validation library that actually meets the full HTML5 form specification. I'm so disappointed; I had such high hopes. |
Sounds like a duplicate of #2156? |
Closing as duplicate of #2156 Thanks @RobJohnston for noticing! |
I have few inputs outside my validate forms, but every input have attr
form="my-form"
.I have this code:
form.validate({ rules: { my_outsude_input: 'required' } });
This don't work.
But
.form.validate().element($(my_outsude_input))
this work.Hovewer
my_outsude_input
invalid, I call form.valid() and gettrue
...Also
.form.validate().element
don't destroy keyup or focusout event whenmy_outsude_input
valid.How can I do this?
The text was updated successfully, but these errors were encountered: