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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---