User:Pmw57/form-handling-techniques

Forms can be accessed either via the forms collection, or a unique identifier. Using a unique id for the form is an effective technique that allows good flexibility as to how the form is accessed and worked with from the scripting.

You can attach a scripting event to the form with: