Hi, i want use pass my twig variable to JavaScript function.
for ex. 
//my twig file
{% set i = 3 %}
//now i want to pass this value of "i" to my javascript "validate function".
{{ form_label(ormEmployee.organization,'Organization') }}
{{ form_widget(formEmployee.organization, {'attr' : {'onchange' : 'return 
validate();'}}) }}

i tried it as 
{{ form_widget(formEmployee.organization, {'attr' : {'onchange' : 'return 
validate({{i}});'}}) }}
it gives syntax error.

So please tell me how to pass it.
Thanks.
 

-- 
-- 
If you want to report a vulnerability issue on Symfony, please read the 
procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to