Rules Validation

hi i have image model and i have placed it in the rules

array(‘userName,binaryfile,email’,‘required’),

but when i click the submit button its not validating it and it loads actionCreate() without checking fields for validation

By default, the method CActiveRecord::save() automatically calls this validation, and requires it to succeed before it tries to save the record.

http://www.yiiframework.com/wiki/56/

but i haven’t entered the username and uploaded file but it doesnt validate them.

When you hit the submit button, It’s going to load the actionCreate regardless of what you enter in the form. In the controller’s create action it will validate the rules on the $model->save() statement.

You may want to post your actionCreate code and your view code.