I work in cakephp1.3. I have to check my form with cakephp validation in model.i added a regular expression to limit the input of special characters.
My code is written below:
var $validate = array( 'name' => array( 'unique'=>array( 'rule' => 'isUnique', 'message' => 'Already taken', ), 'pattern'=>array( 'rule' => '/^[az]$/i', 'message' => 'Only letters allowed', ), 'empty'=>array( 'rule' => 'notEmpty', 'message' => 'This field cannot be left blank', )) );
the 'unique' rule does not work. it worked fine before adding the "pattern" rule to the script. What is the problem? I am trying to arrange the order of the rules mentioned above, I thought there might be some kind of positioning problem, but nothing happened.
plz help me ..
source share