Hello
i'm having some troubles with the "range" validation rule.
i have a form with a standard inputbox.
Here's the validation rule:
var $validate = array(
"Field" => array(
"ValueInRange" => array(
"rule" => array("range",0,100)
)
)
);
The inputbox std value is set to "0,00" (we use commas instead of dots
as decimal separators) by the controller.
Before the validation process starts the string is formatted, and the
commas are replaced by dots
foreach ($this->data as &$model) {
foreach ($model as $campo => &$valore) {
switch ($this->getColumnType($campo)) {
case "float":
$valore = str_replace(",", ".", $valore);
break;
case "date":
case "datetime":
list($g, $m, $a) = explode("/", $valore);
$valore = "$a-$m-$g";
break;
}
}
}
So the validation routine gets
"rule" => array("range", "0.00", "100.00")
It always fails :(
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---