g_form.getControl() is not working

Snow Tomcal
Tera Expert

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 🙂

 

 

4 REPLIES 4

Kristen Ankeny
Kilo Sage

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. 

It's a UI Policy

I would suggest with this scenario to use client scripts instead.

But than I need to use 2 onChange script and an onLoad script