Avatar

Level 10

You can use it in the preSubmit and preSave events, this depends on what you're doing with your form.

You also can add it to an existing script, if you use one to submit the form.