DOM manipulation using client script on service portal forms

pra16
Tera Contributor

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. 

2 REPLIES 2

Harshal Aditya
Mega Sage
Mega Sage

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

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";
}
}