开发者

How to add a script onLoad?

开发者 https://www.devze.com 2023-01-08 19:16 出处:网络
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

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

精彩评论

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