Hi,
Is there a way to add letters only validation in a form field like name should contain letters only and no special characters.
There is a rule for integer only in yii, but, i couldn’t find anything for letters only.
Please advice!
Kul.
Hi,
Is there a way to add letters only validation in a form field like name should contain letters only and no special characters.
There is a rule for integer only in yii, but, i couldn’t find anything for letters only.
Please advice!
Kul.
Thanks a lot! your solution worked nicely!
array('my_field', 'match',
'pattern' => '/^[a-zA-Z\s]+$/',
'my_field' => 'my_field can only contain word characters'),