Hey guys,
Having a weird problem here... In my validation everything was working fine
except now I needed to change the first + surname validation fields to allow
for spaces + dashes. It was originally just working on only alphanumeric
characters. The dashes + underscores was an extra addition added now.
Here is the first name section of the $this->validation variable: (copied
directly from the cakephp book even...)
* // First name:*
* // - cannot be empty*
* // - must be alphanumeric*
*
*
* 'name_first' => array(*
* 'name_first-1' => array(*
* 'rule' => 'alphaNumericDashUnderscore',*
* 'message' => 'First name can only contain alphanumeric
characters and dashes'*
* ),*
*
*
* 'name_first-2' => array(*
* 'rule' => 'notEmpty',*
* 'message' => 'Please enter your firstname'*
* )*
* )*
and I have the function:
* function alphaNumericDashUnderscore($data)*
* {*
* $value = array_values($data);*
* $value = $value[0];*
* *
* return preg_match('/^[a-zA-Z0-9]+$/', $value);*
* }*
Yet the validation still comes back as a failure each time... I can't figure
this out... it should be rather simple but I just can't get it...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---