Hi,

@Lucas =>
For compulsory fields in a form the validation in model will be like:

   var $validate = array(
                'field_name' => array(
                                'notEmpty' => array(
                                                'rule' => 'notEmpty',
                                                'message' => 'Required'
                                        )
                        )
       );

Above will make it compulsory for the field to have data when
submitted.
____________________________________________________________________________

@josnidhin =>
The validation error will be shown automatically along the fields if
you are creating inputs using form helper.
Otherwise the below code will work:

<? if($form->isFieldError('ModelName.field_name')){e($form->error
('ModelName.field_name'));}?>


Have a nice day!

On Jan 7, 11:36 am, josnidhin <[email protected]> wrote:
> Hi,
> I am also experiencing the same problem. I dont know how to get the
> messages to show in the view when the validation fails.
>
> On Jan 4, 12:31 am, Lucas <[email protected]> wrote:
>
> > Hi gearvOsh,
>
> > Unfortunately nothing happens again :(
> > I tryed with both options (required = true and notEmpty rule) and
> > nothing happens.
>
> > More tips?
>
> > Thanks!
>
> > On 29 dez 2008, 23:24, gearvOsh <[email protected]> wrote:
>
> > > You either need to have:
>
> > > required = true
>
> > > Or use the notEmpty rule.
>
> > >http://book.cakephp.org/view/127/One-Rule-Per-Fieldhttp://book.cakeph...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to