- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2017 12:42 AM
Hi,
I am using client onLoad script to set all editable fields to read-only. But it is not working for reference fields.
function onLoad() {
//Type appropriate comment here, and begin script below
if (u_status = 'Released')
{
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
// g_form.setReadOnly('u_seat_number', true);
// g_form.setReadOnly('u_name', true);
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2017 01:18 AM
I tried g_form.setDisabled(), but it didn't work.
But, I have used UI policy and it worded for reference fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2017 01:05 AM
i think instaed of readonly you can user set disable method to lock that field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2017 01:18 AM
I tried g_form.setDisabled(), but it didn't work.
But, I have used UI policy and it worded for reference fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2017 12:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 08:30 AM - edited 02-16-2023 09:49 AM
Hi there,
Sometimes in order to make function calls like `setReadOnly` or `setDisabled` work correctly, it's needed to check are these fields to be set also have extra settings like mandatory, if yes, make sure to un-mandatory them first:
g_form.setMandatory(field, false);
g_form.setDisabled(field, true);
Regards.