Monday, June 29, 2009

Issue in validation

Hi all,

I am facing issue in displaying error message for validation.
I have added following code in model

var $validate = array(
'product_name' => VALID_NOT_EMPTY
);

and following code in view file i.e. add.thtml

<?php echo $form->input('product_name', array('size' => '15', 'name'
=> 'product_name', 'error' => false)); ?></td>
<?php echo $form->error('<table_name>.product_name', 'Please enter
product name'); ?>


But it is not displaying error message. Can anybody help me? Do we
need to modify controller also for validation?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: