The ‘message’ key allows you to define a custom validation error message for
the
rule:
var $validate = array(
'password' => array(
'rule' => array('minLength', 8),
'message' => 'Password must be at least 8 characters long'
)
);
http://book.cakephp.org/view/127/One-Rule-Per-Field
On Wed, Jul 15, 2009 at 4:45 PM, Dhileepen Chakravarthy <
[email protected]> wrote:
> <!-- File: /app/views/posts/add.ctp -->
>
> <h1>Add Post</h1>
> <?php
> echo $form->create('Post');
> echo $form->input('title');
> echo $form->input('body', array('rows' => '3'));
> echo $form->end('Save Post');
> ?>
>
> <?php
> class Post extends AppModel
> {
> var $name = 'Post';
> var $validate = array(
> 'title'=>VALID_NOT_EMPTY,
> 'body'=>VALID_NOT_EMPTY
> );
> }
> ?>
>
> If i am not enter any value then it says "This field cannot be left blank"
> but i want to show a message "Please enter Title"
> How do i do?
>
> 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
-~----------~----~----~----~------~----~------~--~---