So I've searched this group and other places on the web, and I still
can't seem to figure out why Validation rules don't work. It seems
others have had this problem, but only one solution works, and it is
totally contrary to what every other Manual, API, or Blog post has
said SHOULD work.
I am trying to get a field to simply be required. That's it. This is
the only piece of code I can get to work, and it seems like overkill
for this simple rule:
var $validate = array(
'port_client' => array(
'client_required' => array(
'rule' => array('alphaNumeric'),
'required' => true,
'allowEmpty' => false,
'message' => 'You must enter a client for this
item.'
)
)
)
I've tried the following (the first of which comes right out of the
cookbook), all to no avail:
var $validate = array(
'port_client' => array(
'rule' => 'alphaNumeric',
'required' => true
)
);
-----------------
var $validate = array(
'port_client' => array(
'required' => true
)
);
-------------------
When I use the latter two pieces of code and try inputting a value
into the field, it doesn't validate, it gives me the 'Required' or
'This field can't be blank' message, even though there is clearly
something in the field.
Environment Stats:
- PHP 5.2
- CakePHP 1.2
- Database: MySQL 5.0
Any help is appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---