This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » Form Validation - No error but not valid!?
Form Validation - No error but not valid!? [message #89732] Thu, 10 December 2009 13:24 Go to next message
krypton2k  is currently offline krypton2k
Messages: 22
Registered: March 2009
Junior Member
When i submit my form which contains several merged forms I get no validation errors but the form wont validate.

$form->isValid() returns false.

I am not sure how to debug this. I have tried removing several fields and forms but it always responds the same.

is there some way to see what is failing ?
Re: Form Validation - No error but not valid!? [message #89778 is a reply to message #89732 ] Fri, 11 December 2009 00:27 Go to previous messageGo to next message
Levelx  is currently offline Levelx
Messages: 358
Registered: April 2009
Location: Germany
Faithful Member
Often there is a error to a field, where you don't render the error messages.

You can add as a test the $form variable in your template to see the complete automatic generated form (with al errors) or you can add something to render all errors of the form. Therefore use the following code:

<?php
        $errors = $form->getErrorSchema()->getErrors();
        if (count($errors) > 0)
        echo 'List of Errors:' . '<br>;
        {
	        foreach ($errors as $name => $error)
	        {
            echo $name . ': ' . $error . '<BR>';
	        }
        }
 ?>
Re: Form Validation - No error but not valid!? [message #89780 is a reply to message #89778 ] Fri, 11 December 2009 00:38 Go to previous messageGo to next message
krypton2k  is currently offline krypton2k
Messages: 22
Registered: March 2009
Junior Member
Thanks for this, what i did to solve the problem was i rendered the whole form as you suggested and looked for the extra fields that I had forgotten to unset. I really appreciate your help.

[Updated on: Fri, 11 December 2009 00:38]

Re: Form Validation - No error but not valid!? [message #101483 is a reply to message #89778 ] Wed, 23 June 2010 12:37 Go to previous message
dipesh  is currently offline dipesh
Messages: 2
Registered: June 2010
Location: Nepal
Junior Member
thank you very much it helped me a lot.
Previous Topic:Problem : Display img tag instead of the picture
Next Topic:getComponent method in Batch File (Custom tasks)
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software