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

Using DropKick with form validation. #313

Closed
benlevydesign opened this issue Oct 24, 2015 · 2 comments
Closed

Using DropKick with form validation. #313

benlevydesign opened this issue Oct 24, 2015 · 2 comments

Comments

@benlevydesign
Copy link

Is it possible to use DropKick with form validation. See the form on my website where I have two select elements. Without using dropkick they would normally get validated. I am using jqueryvalidation to do my validation.

@wwilsman
Copy link
Collaborator

Hey Ben,

By default, Dropkick hides original select elements with display: none. There's an option for .validate() called ignore which defaults to ":hidden". This means that it is ignoring the original select elements, and since Dropkick isn't a normal form control, no validation is being performed on them.

You have 2 possible solutions:

  1. Hide the original select elements another way.
  2. Override the default ignore option.

Hope this helps!

@benlevydesign
Copy link
Author

This what I ended up doing and it works as should!

ignore: {
  hidden:"not(.selectoptions)",
  hidden:"not(textarea.tinymce)"
},

I also added tinymce to my textarea form field. It hides the original textarea form field so, you need to include textarea.tinymce in the same do not ignore option.

Thanks!

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