Hi,

I simply don't understand why I can set a default value on a form element if this default value is not taken into account when validating the form???

Here is my controller code:

$form = new My_Form(); // The form defines a element named 'nature' that is 
REQUIRED
$form->setDefault('nature', 'consignment');
...
// Content of the $_POST:
// array(
//    'foo' => 1,
//    'bar' => 2
// )
// NO 'nature' value is posted by the HTML form

if ($request->isPost()) {
    if ($form->isValid($_POST)) {
        // never reached as isValid() fails on 'nature'
    }
}

Any explanation?
--
Guillaume ORIOL
Software engineer
Technema

Reply via email to