Nerdicon Nerdicon - 1 year ago 107
Javascript Question

passing id's to modals symfony 2.3

Is there any way to pass id's to modals in symfony 2.3?

here's an example:

<a href="{{ path('route', {'id'}) }}" data-reveal-id = "modal" class = "icon" etc.>

so first, without the data reveal the icon becomes a link that when clicked, it goes to the action in the route. That's fine since it's working.

<div id="modal" class="reveal-modal large">
<input type="password" id="someid"/>

In my modal I have a password input type, I have a jquery that submits this form, my problem is that this time the code doesn't go to the route.

Anyone with answers will be greatly praised. I swear you won't hear me but I WILL be praising you, thanks in advance.

P.S. I'm fairly new to symfony and the 2.3 documentation just vanished from the site so i'm not sure where to get the info I need other than here.

Answer Source

Set the form 'action' attribute with setAction, when you create your form :

$form = $this->createFormBuilder($entity)
->add('name', 'text')


$form = $this->createForm(
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download