Unable to hide a field using UI Policy and Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 08:51 AM
Hi Team,
I am not able to hide a mandatory field using UI Policy and Client script . I am using a below script,
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'Change default group'){
g_form.setMandatory('dl_location',false);
g_form.setDisplay('dl_location', false);
//document.getElementById("dl_location").style.display = "none";
g_form.setMandatory('unix_gp_name',false);
g_form.setDisplay('unix_gp_name', false);
}
else {
g_form.setMandatory('dl_location',true);
g_form.setDisplay('dl_location', true);
g_form.setMandatory('unix_gp_name',true);
g_form.setDisplay('unix_gp_name', true);
}
}
Note: unix_gp_name is also a mandatory field, using the above script I am able to hide it. But I am not able to hide dl.location.
Please help.
Thank you.
Saridha.L
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 09:49 PM
Hi Saridha,
- The fields in a UI policy condition must be visible (even if hidden by UI policy or read-only) on the form for the condition to be tested.
- The priority order for UI actions types is:
- Mandatory (highest)
- ReadOnly/Display
If a Field is set to mandatory and does not have value, readonly or hide do not work on that Field. If a Field is hidden or readonly, and then set to mandatory, the field becomes visible or editable.
Mark If Helpful
Thank You