Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dynamic script to make fields read only

It runs when the field value changes.On change client script
If the new value equals '7', it retrieves all editable fields using g_form.getEditableFields().
Then it loops through each field and sets it to read-only using g_form.setReadOnly().
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
It runs when the field value changes.
If the new value equals '7', it retrieves all editable fields using g_form.getEditableFields().
Then it loops through each field and sets it to read-only using g_form.setReadOnly().

*/


function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}


if (newValue == '7') { // update condition as required
var fields = g_form.getEditableFields();
for (var i = 0; i < fields.length; i++) {
g_form.setReadOnly(fields[i].getName(), true);
}

Loading