Hello.

i have a simple view with a form like this

<?php
echo $form->input("Order.Code");
for ($i = 0, $i < 10, $i++) {
        echo $form->input("Order_Items.". $i .".Code");
        echo $form->checkbox("Order_Items.". $i .".Bargain");
}
?>

the view returns an array like this

Array => (
        [Order] => Array(
                [Code] => XXX
        )
        [Order_Items] => Array(
                [0] => Array(
                        [Code] => Item1
                        [Bargain] => 1
                )
                [1] => Array(
                        [Code] => Item3
                        [Bargain] => 0
                )
                [2] => Array(
                        [Code] => Item3
                        [Bargain] => 0
                )
                [3] => Array(
                        [Code] =>
                        [Bargain] => 0
                )
                [4] => Array(
                        [Code] =>
                        [Bargain] => 0
                )
                [...]
        )
)

And so on...

User can input any number of lines. in the above example only the
first 3 lines were filled.

and... here's the problem...

every blank line fails validation ("Item.Code" has a "notEmpty" rule)
and stops saving operations

so... is there any smart way to discriminate between blank and user-
input lines?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to