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 t开发者_JAVA百科his 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
精彩评论