[eluser]jpcote[/eluser]
The only way to solve that was to not use the validation class anymore.
I do the validation in a foreach and I verify for every rules I need.
It's not as beautiful as the validation class but I works with my form...
Code:
$valid = true;
$error = '';
// valid_date
if(!strtotime($_POST['required_date'])) {
$valid = false;
$error .= 'Date is not valid.<br>';
}
for($i=0;$i<$numberoflines;$i++) {
// required|is_numeric|!is_empty
if(isset($_POST['price_unit'][$i]) && (!is_numeric($_POST['price_unit'][$i]) || strcmp($_POST['price_unit'][$i],'')==0)) {
$valid = false;
$error .= 'The price of "'.$_POST['name'][$i].'" is not valid.<br>';
}
// required|is_numeric|!is_empty
if(isset($_POST['number'][$i]) && (!is_numeric($_POST['number'][$i]) || strcmp($_POST['number'][$i],'')==0)) {
$valid = false;
$error .= 'The number of "'.$_POST['name'][$i].'" is not valid.<br>';
}
}
if ($valid === FALSE)
{
//DISPLAY $ERROR
}
else
{
//DO THE RIGHT THING
}