Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

What is the use of control parameter in onChange in Client script

Nagaraj Bhatkal
Kilo Contributor

What is the use of control parameter in onChange in Client script

1 ACCEPTED SOLUTION

Sanjay Bagri1
Tera Guru
Tera Guru
Hi, Control parameters are generally used for If we wants to change the dynamically field size, length etc in ui page . So we will use control parameter inside client script in onChange type. Please mark correct/ helpful if helpful for you . Thanks

View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Nagaraj,

 

I don't think control parameter is an OOTB field. Is this a custom field on your instance? A screenshot will be helpful.

 

-Pradeep Sharma

Jaydeep Parmar
Kilo Guru

Hi,

onChange() — runs when a particular field value changes on the form. The onChange() client script must specify these parameters.
  • control: the DHTML widget whose value changed.
  • oldValue: the value the widget had when the record was loaded.
  • newValue: the value the widget has after the change.
  • isLoading: identifies whether the change occurs as part of a form load.
  • isTemplate: identifies whether the change occurs as part of a template load.

Sanjay Bagri1
Tera Guru
Tera Guru
Hi, Control parameters are generally used for If we wants to change the dynamically field size, length etc in ui page . So we will use control parameter inside client script in onChange type. Please mark correct/ helpful if helpful for you . Thanks

Hi Sanjay

Thanks for the response.

Can you please give me some examples for control parameter.

Thank you.