Hi Akeda, Thanks! It worked!!!
On Jan 20, 10:46 am, Akeda Bagus <[email protected]> wrote: > On Thu, Jan 21, 2010 at 1:05 AM, leafchild <[email protected]> wrote: > > In my model, > > ============================================ > > var $validate = array( > > 'name'=>array( > > 'no_empty'=>array( > > 'rule'=>VALID_NOT_EMPTY, > > 'message'=>'Please enter your name' > > ) > > ), > > 'email'=>array( > > 'emailchk1'=>array( > > 'rule'=>VALID_EMAIL, > > 'message'=>'Please enter valid email address' > > ) > > > ) > > > ); > > ============================================ > > > The Name field is required field but email is not but when I don't > > fill email, > > then I get email error message, 'Please enter valid email address'. > > > I didn't make email field as required filed but I can not continue > > unless I fill in email address. > > > What's going on?? > > Try this: > var $validate = array( > 'name' => array( > 'no_empty' => array( > 'rule' => 'notEmpty', > 'message' => 'Please enter your name' > ) > ), > 'email'=>array( > 'emailchk1' => array( > 'rule' => 'email', > 'allowEmpty' => 'true', > 'message' => 'Please enter valid email address' > ) > ) > ); > > allowEmpty allows email field to be empty or nonempty > -- > regards, > gedex > > blog:http://gedex.web.id
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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
