[size="3"]Hello Every one!

Can any body help me with the validating two fields in such a manner that minimum data value should not be more than maximum data value.

Eagerly waiting for your replies.


replace it with your rules method in your model and fieldname with your fields

public function rules()


		return array(

                         array('fieldname', 'length', 'min'=>3, 'max'=>12),

                         array('fieldname2', 'length', 'min'=>3, 'max'=>12),



[size="3"]Thanks Alirz for your help.

Will this work for putting the validation that fieldname1 value should be lesser than fieldname2.