I have to be honest here I am not programming inclined. I have no idea how to apply your sample to my actual problem...
On Dec 11, 6:30 pm, Jeremy Burns | Class Outfit <jeremybu...@classoutfit.com> wrote: > You need an nested array: > > var $validate = array( > 'fieldName' => array( > 'ruleName1' => array( > 'rule' => ..rule..., > 'message' => ...message..., > 'last' => true > ), > 'ruleName2' => array( > 'rule' => ..rule..., > 'message' => ...message... > ) > ) > ); > > This will make it check ruleName1 first, then ruleName2 and so on. You can > call them whatever you want, but I generally mirror the actual rule name > (e.g. notEmpty etc). The 'last' option will make it stop there for that field > if the validation rule fails, else it will continue on and only report the > final broken validation rule for that field. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 11 Dec 2010, at 10:25, John Maxim wrote: > > > In email validation - tutorial IBM build a quick web: if it is left > > blank, the message displays "enter a valid email". > > > How to make it so it displays "this field cannot be left blank" ? > > > Only when something not-email entered in it so does it display "enter > > a valid email" ... > > > I see we at least need to create 2 validation for email field ? the > > below is what is being used at the moment: > > > class User extends AppModel > > { > > var $name = 'User'; > > > var $validate = array ( > > 'username' => array ('rule' => '/^.{6,40}$/'), > > 'password' => array('rule'=>'/^.{6,40}$/'), > > 'email' => array('rule'=> array('email', true), > > 'message' => 'Enter a valid email') > > > ); > > > } > > > Any help with this ? > > > Thanks ! > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en