Statistics
The Highest Post







Statistics
Count 94
Avg 21.00
Min 21
Max 21
Angualr Top questions

Details



Client Script Types Continue? 2) onSubmit() Scripts An onSubmit() script runs when a form is submitted. Typically, you use an onSubmit() script to validate things on the form and ensure that the submission makes sense. As such, onSubmit() scripts can potentially cancel a submission by returning false. An onSubmit() script must contain a function named onSubmit(). For example, here is an onSubmit() script that prompts the user to confirm that a priority one ticket should really be submitted. If the user clicks Cancel in the confirmation dialog box, the submission is canceled. function onSubmit() { var priority = g_form.getValue('priority'); if (priority == 1) return confirm('Are you sure you want to submit a priority one ticket? The CIO will be notified!');} }
Related Topics