DOM manipulation using client script on service portal forms
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 09:25 AM
Trying to change the form field css in service portal form based on a flag using client script. But since DOM manipulation is blocked. How do we proceed? Custom widget is an option but wanted to know if there's any other way to work around it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 09:35 AM
Hi @pra16 ,
Hope you are doing well.
Please try to update isolated script value to false for client script and try to execute again.
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 05:03 AM
Thanks @Harshal Aditya, have already tried that, it didn't execute. For reference I'll share the script I've been using:
function onLoad(){
var elementID = document.getElementById("table.field");
var overdue_flag = g_form.getValue('overdue');
if(overdue_flag) {
elementID.style.backgroundColor = "red";
}
}