Closed schingeldi closed 11 years ago
Look to controller. Action method should return for the template something like this 'form' => $form->createView(),
Thanks for the fast reply. But this is what I checked before:
return array('form' => $form->createView());
And if it would not be a correct FormView, the template would not be able to render it, right?
Maybe the order in your template. Maybe the form is null after rendering? Put the jsfv in first.
Hi. Thanks for all your help. I finally found the error. It was a misspelling of my form fields.
Entity field was
$firstName
form field was
first_name
And I had only three fields in my form, all having an underscore. I would have thought that I at least get an error, because of the names do not match, but nevertheless it was all my fault. Sorry for the confusion.
Now, jquery don't generate errors when a field is not found.
I have two projects. In one everything works fine, in the other there is no validation. I debugged it as far as I could and found out, that in
APY\JsFormValidationBundle\Twig\Extension\JsFormValidationTwigExtension:: JsFormValidationFunction the passed $formView is null. In my working project this is a object of Class FormView.
I debugged everything I could and before passing the created form form to my twig template, it is of type
Symfony\Component\Form\FormView
The form in the template is rendered fine.
Does anyone have an idea how I could sove this? Any debugging suggestions?