Faizi
Tera Contributor

Generally we can write the OnLoad statement within the Onchange script as below:

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return; // Here we write the onload code
}

//Here we generally write the onChange code

}

Can we write the onChange function within onLoad script, Yes. Please refer below code:

function onLoad() {

gel('ni.IO:' + sys_id_of_variable).onchange = function() {

/*
------------------------- // Here we can write the Onchange code
-------------------------
-------------------------
*/
}
}

 

It will reduce the re-write the multiple on-change scripts.

 

Thanks,

 

Faiji

Comments
Faizi
Tera Contributor

Please mark helpful if helps.

koti10
Kilo Contributor

Hi 

i wrote the onchange code within onLoad script , but it is not working...it is possible this way

Faizi
Tera Contributor

Hello Koti,

 

Yes. Its possible. Let me know what you are trying or want to achieve. 

koti10
Kilo Contributor

Thank you for reply.

'gel' means getElementByID from onChange...

Version history
Last update:
‎03-04-2018 09:18 PM
Updated by: