try to use this array for the body...
'body' => array(
'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'The body field cannot be
blank.'
),
'minlength'=>array(
'rule'=>array('minLength',100),
'message'=>'The bodymust be atleast 100
characters .'
)
)
On Wed, Jul 15, 2009 at 5:41 PM, Dhileepen Chakravarthy <
[email protected]> wrote:
> Thanks jeff.
>
> I tried like this.
>
> <?php
> class Post extends AppModel
> {
> var $name = 'Post';
> /*var $validate = array(
> 'title'=>VALID_NOT_EMPTY,
> 'body'=>VALID_NOT_EMPTY
> );*/
> var $validate = array(
> 'title' => array(
> 'rule' => VALID_NOT_EMPTY, // or: array('ruleName', 'param1', 'param2'
> ...)
> 'required' => true,
> 'allowEmpty' => false,
> 'on' => 'create', // or: 'update'
> 'message' => 'Please enter Title this field should not be empty'
> ),
> 'body' => array(
> 'bodyRule1' => array(
> 'rule' => VALID_NOT_EMPTY, // or: array('ruleName', 'param1', 'param2'
> ...)
> 'required' => true,
> 'allowEmpty' => false,
> 'on' => 'create', // or: 'update'
> 'message' => 'Please enter Body this field should not be empty'
> ),
> 'bodyRule1' => array(
> 'rule' => array('minLength', '100'),
> 'message' => 'Minimum length of 100 characters'
> )
> )
>
> );
>
> }
> ?>
>
> What i need is body is empty then show 'Please enter Body this field should
> not be empty' if it is not empty check the minLength is 100. then message
> 'Minimum length of 100 characters'
>
> How do i fix this issue
>
> Regards,
> Dhileepen
>
>
> >
>
--
--
(¨`•.•´¨) I may be busy,
`•.¸(¨`•.•´¨) but I assure you,
(¨`•.•´¨)¸.•´ you are always in my heart
`•.¸.•´
With Lots of Love.....
THANKS AND REGARDS
Jeffery Jacob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---