How to make a Onchange client script for when any form field changes and not a particular one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 10:30 AM
Hello! I need to make a Onchange client script for when any form field changes and not a particular one? I configured the client like this leaving the Variable Name field blank but the client script doesn't fire. Any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 10:40 AM
The system does not support this OOB. The only think you can do is create a UI script that has a function in it that does whatever the work is and then create a onChange script that calls that function. There are some other options that are way more complicated and require DOM manipulation and I do not recommend those.
You could request this in an Idea on the Idea portal if its not already out there.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 02:24 PM
Hi,
For anyone who comes across this post through search engines, I was able to set up an onLoad Client Script that listens to any field changes by registering a handler using g_form.onUserChangeValue() .
function onLoad() {
var handler = function (fieldname, originalValue, newValue) {
g_form.showFieldMsg(fieldname, 'Old val: '+ originalValue + '\nNew val: ' + newValue, 'info');
if (fieldname == 'category') {
//do something
}
};
g_form.onUserChangeValue(handler);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 10:21 PM
Nice to know they added something for this.