Better user both notEmpty and required. Required will raise validation error when field do not present in POST data at all. notEmpty without required will not do it.
On Jan 15, 2:26 pm, "Louie Miranda" <[email protected]> wrote: > Hi! Yes, this one.http://book.cakephp.org/view/740/notEmpty > > Works! I thought from the other examples that is how I should do it, until I > found your suggestions and googled notEmpty. > > Thanks again! > -- > Louie Miranda ([email protected])http://www.louiemiranda.net > > Security Is A Series Of Well-Defined Steps > chmod -R 0 / ; and smile :) > > On Thu, Jan 15, 2009 at 3:30 PM, phpcurious <[email protected]>wrote: > > > > > Louie, > > > I read it somewhere in some people's blog, that the 'required' > > validation rule doesn't really mean the field being required. Even I > > don't get much the idea of it. But You might consider checking up > > "notEmpty" instead if you want the field not to be empty. > > > On Jan 15, 1:52 pm, "Louie Miranda" <[email protected]> wrote: > > > Guys, is there a new way of doing a simple this field is required? true > > or > > > false? > > > > The code example and my code below, does not work. > > > > My code: > > > > var $validate = array( > > > > > 'officer'=>array('required'=>true) > > > > ); > > > > I am using CakePHP (Stable/Latest release). I get an error of... > > > > > preg_match() [function.preg-match <http://php.net/function.preg-match > > >]: > > > > Delimiter must not be alphanumeric or backslash [* > > > > CORE/cake/libs/model/model.php*, line *2413*] > > > > Shall I always use alphanumeric on the rule? I just want to make it > > > required, true or false. Is it still the same? > > > > Help! > > > -- > > > Louie Miranda ([email protected])http://www.louiemiranda.net > > > > Security Is A Series Of Well-Defined Steps > > > chmod -R 0 / ; and smile :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
