Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
onChange Client Script behavior differs between platform and portal after an upgrade - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • onChange Client Script behavior differs between platform and portal after an upgrade
KB0748702

onChange Client Script behavior differs between platform and portal after an upgrade


1397 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

Before London, onChange events are fired when a field is set to the same value via a Client Script on the Service Portal. Since London, the event is not fired in this scenario, even if no script settings have been changed before/after upgrading. The onChange script behavior has changed between platform and portal after the upgrade.

Steps to Reproduce

1. Create a catalog item with 3 "Single Line Text" variables:
u_1, u_2 & u_3.

2. Create an onChange client script to get the value from field u_2, then put it back into the field u_2 as below:
onChange: Field = u_1:
var u2 = g_form.getValue ('u_2');
g_form.setValue ('u_2', u2);

3. Create a second script to catch onChange from the field above (u_2) and trigger a 3rd field to be updated:
onChange: Field = u_2:
var u1 = g_form.getValue('u_1');
var u2 = g_form.getValue('u_2');
var u3 = u1 + u2;
g_form.setValue('u_3',u3);

4. Open the form on the platform and notice the following expected:
Updating u_1 results in nothing happening (because u_2 is empty and the script catches newValue=='')
Updating u_2 result in an update to u_3 (appending u_1 and u_2)
Updating u_1 again triggers u_3 to change (because u_2 is not empty)

5. Try the portal and observe the following changes (in previous releases the portal used to catch the onChange event when setting a field to the same value):
Updating u_1 results in nothing happening
Updating u_2 result in an update to u_3 (appending u_1 and u_2)
Updating u_1 again does not trigger u_3 to change

Workaround

This problem is under review. To receive notifications when more information becomes available, subscribe to this Known Error article by clicking the Subscribe button at the top right of this form.

 


Related Problem: PRB1321322

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.