- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-04-2018 09:18 PM
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
- 1,784 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Please mark helpful if helps.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
i wrote the onchange code within onLoad script , but it is not working...it is possible this way
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Koti,
Yes. Its possible. Let me know what you are trying or want to achieve.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you for reply.
'gel' means getElementByID from onChange...