- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2022 02:17 AM
Hi everyone!
I created an onChange client script to change the color of a reference field on my form when it changes, but somehow my code doesn't work. The trigger condition is the same field that's color should be changed.
if (conditionValue == "1") {
var element = g_form.getElement('reference_field');
element.style.backgroundColor = "red";
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2022 02:47 AM
Hi,
User getDisplayBox() instead of getElement().
e.g.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var c = g_form.getDisplayBox('user');
c.style.backgroundColor = 'red';
}
execution result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2022 02:59 AM
Hi Csaba,
Please check if isolate script checkbox is set to true. If it's true please make it false and then test it again.
Thanks!