onSubmit client scripts

The onSubmit client script is similar to the onLoad script. Unlike the onChange script, when creating the onSubmit client script, we do not need to specify the field as it is triggered when the form is submitted. Other properties, such as table, view, and type, must be set similar to the onLoad and onChange client scripts.

When creating the onSubmit client script, to compare Start Date and Return Date, we will leave the Global checkbox checked to ensure this script is executed for all views of the Booking Request table/form.

In Studio, open a new Client Script record form, as shown in the following screenshot, and populate the form fields with the following values:

  • Name: Compare start and return date
  • Table: Booking ...

Get ServiceNow Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.