kartik-v / yii2-datecontrol

Date control module allowing separation of date formats for View & Model for Yii Framework 2.0.
http://demos.krajee.com/datecontrol
Other
55 stars 29 forks source link

Datecontrol and "required" validation rule doesn't play nice together? #100

Closed dnunes closed 7 years ago

dnunes commented 8 years ago

I am trying to use the DatePicker and a "required" rule on my model, but on the client side the hidden field doesn't seem to be updated with the value of the datepicker, which means the "required" validation fails when the form will be submited. Any ideas?

kartik-v commented 7 years ago

This should not be the case. This is precisely the reason why the DateControl extension was built so that the core DB/model field can have other Yii validations.

You can cross check with the DateControl demo page to understand how the validations (like required is enforced) and also it displays the value of the hidden input in the demo for you to cross check.