In my form\'s model, I have a custom validation function for a field defined in this way
class SignupForm extends Model
{
public function rules()
{
Try forcing the validation on empty field
['birth_date', 'checkDateFormat', 'skipOnEmpty' => false, 'skipOnError' => false],
Also, make sure you don't assign id to your birth_date
field in your view.
If you do have id for your birth_date
, you need to specify the selectors
= $form->field($model, 'birth_date', ['selectors' => ['input' => '#myBirthDate']])->textInput(['id' => 'myBirthDate']) ?>