Getting Problems In Validating Date

I am using

array('user_authen_info_bday','type','type'=>'date','dateFormat' => 'd-M-yyyy'),

this to validate a date in 1-1-2014 format but it is not working … rules checks that date is blank or not but they are not checking it is valid or not. and yup one more point the in yiiactiveform there is also not rule for the valid date … there is a rule for blank date but not for valid date… :unsure: what i should do…? thanks in advance


please see it…

hope it’s may help…

Hi ankit i have tried both


and also

array('user_authen_info_bday','type','type'=>'date','dateFormat' => 'd-M-yyyy')

but no one is working …

actually i am taking values day month and year separately by dropdownfield and by jquery i am getting the value of user_authen_info_bday … may be it can be the reason why it is not working… if its the reason then the checking of date is blank or not should also not work but it is working perfactly…

should i have to use regex for it…?

and also one more question d-M-yyyy format can be checked…?

yes you want to uses regex because get the value using jquery so i think it’s not possible on yii rules fuunction

ok thanks

user_authen_info_bday filed is defind the model or not?

yes it is…

validation rule is working perfactly server side but it is not checking at client side…

i used

array('user_authen_info_bday','date','format' => 'd-M-yyyy'),

so it should be working client side but it is not…

any problem or not available…? :rolleyes: :blink:

and u from gujarat …?