g_form.getControl() is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 05:50 AM
Hi All,
I tried to create an onChange script that works on multiple fields.
Script -
var field1 = g_form.getControl('field_1');
var field2 = g_form.getControl('field_2');
if(field1.changed || field2.changed){
//do something
}
but field1.changed is undefined.
Does anyone know how to fix it?
Thanks in advanced 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 06:08 AM
If it needs to be a client script, you would do an on change against each field, in separate client scripts. You will need to handle for ensuring you don't cause circular logic on the form. If it doesn't have to happen during user interaction with the form, you can do a single business rule that looks at whether either field has changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 06:09 AM
It's a UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 06:33 AM
I would suggest with this scenario to use client scripts instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 06:36 AM
But than I need to use 2 onChange script and an onLoad script