Grey out fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 11:51 AM
How to grey out all fields except one on a form when update button is clicked ?
I want to make child incidents uneditable but only parent incident field is editable once user click on Update Button

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 12:31 PM
You should use an ACL to make fields read-only if 'Parent' field is not empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 12:37 PM
There is several ways to do it. You can use UI Policies, onChange client scripts, etc, but all of these are not security per se, only cosmetic, Security comes with ACL.
In your scenario, when the update button is clicked, does a status change or something like this? Let me know and we can start drawing a solution for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 10:53 PM
if I write a UI Policy,
do I need to write g_form.setReadonly for each field present on the form.
Is there any other way to make all fields read only except one on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 09:50 AM
Hi Avani,
You can try to use a script on the UI Policy to make all fields readOnly (and add a if fieldname != something to skip a field from readOnly) and use DOM elements to make all readOnly. Your script will look something like this:
var list = document.getElementsByClassName("form-group");
var x=0;
for (x=0; x<list.length; x++) {
console.log(x);
var element = list[x].getElementsByTagName("input");
var field = element[0].name;
var fieldName = field.split(".");
if(fieldName[2] !== undefined) {
var fn = fieldName[2];
g_form.setReadOnly(fn, true);
//console.log(fn);
}
}
It needs a bit of work but it goes around this.
Best regards,
Felipe