开发者

How to add a script onLoad?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜