Jump to:

23546 Posts in 19335 Topics by 2889 members

General Questions

SilverStripe Forums » General Questions » adding javascript to a form

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 973 Views
  • TerryMiddleton
    Community Member
    108 Posts

    adding javascript to a form Link to this post

    How do you add javascript processing to a form?

    I see that it builds the js for the form when you have required field. How can I add a little more process like: is field x a certain length?

    I have the code, I just don't know how t add it to the form processing?


  • Willr
    Forum Moderator
    5511 Posts

    Re: adding javascript to a form Link to this post

    In the function you are outputing the form in - like function Form() you need to include Requirements::customScript("My JS HERE") or Requirements::javascript("link/to/file.js"); which will include the given JS with the form

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.