vitalets / combodate

Dropdown date and time picker
http://vitalets.github.com/combodate
207 stars 82 forks source link

does not work with jquery validation? #60

Open jinfang1234 opened 8 years ago

jinfang1234 commented 8 years ago

This plugin seems not working with the jquery validation. Below is an sample codes showing that validation does not take effect. Can you please advise?

http://jsfiddle.net/5m6gG/376/

Thanks! Jin Fang test1

bipin244 commented 7 years ago

i think combodate is hidden fields and jquery validate by default ignore combodate so add ignore: [], in validate example link is here : [http://jsfiddle.net/5m6gG/439/]

dnasir commented 7 years ago

@bipin244 I don't think that's a good solution because there are situations where a field may be hidden because it's irrelevant to the current state of the form, and only becomes relevant based on the value of another field.

I propose using the .sr-only technique introduced in Bootstrap to hide the actual input field. This way the field will not be considered hidden by jQuery (the default ignore value is :hidden) and validation will kick in.