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