Ivan Borysenko Ivan Borysenko - 1 year ago 158
Ajax Question

Sonata Admin Dependent Select ajax returns empty value

I have form with dependent selectBoxes.
I read tutorial http://symfony.com/doc/current/form/dynamic_form_modification.htmL

But in my representation ajax always return empty value
I use Sonata Admin

Answer Source

You controller Action must implement method:

 if ($request->isXmlHttpRequest()) {
        return $this->render('MyBundle:Task:ajax-template.html.twig', [
           'form' => $view,

And template:

{{ form_start(form) }}
{{ form_end(form) }}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download