How to have an on change client script apply to a field from an extended table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2023 07:12 AM
Hello,
I have two fields from an extended table, "Reason" and "Text Box", that I display on the parent table. "Text Box" should be hidden. If a certain choice, "other" is selected on the "Reason" field, "Text Box" should no longer be hidden. I am able to do this on load with a UI policy, where I just do:
if(g_form.getValue('u_dextension.reason') == 'other'){
g_form.setVisible('u_dextension.text_box', true);
} else{
g_form.setVisible('u_dextension.text_box', false);
}
This works, but it requires me to update the entire form. I was wondering if there was a way to do this upon just change of the field, similar to an on change client script. So when I simply click another choice, the "text box" field could be shown or hidden instantly. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2023 07:18 AM
I don't think so since you might not be allowed to select that field on parent table's onChange client script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader