Hello,
I have to add a Javascript onLoad on a tag : I have a form and I want to disable an input at load.
How can I do this with symfony please ? I have to do this only for forms, so I can't add it in the tag of the layout
Hello,
I have to add a Javascript onLoad on a tag : I have a form and I want to disable an input at load.
How can I do this with symfony please ? I have to do this only for forms, so I can't add it in the tag of the layout
You can use the view.yml to add your js script only on the views containing forms. Like this:
yourViewSuccess:
javascripts: [yourscript.js]
If you want to use the onload or onready, see this link : http://docs.jquery.com/How_jQuery_Works#Launching_Code_on_Document_Ready