Read-Only
- Last UpdatedJun 25, 2024
- 1 minute read
Use scripts for the Read-Only property to allow or deny a user to enter a value for the control.
To allow or deny a user to enter a value for a control
-
Code the script as follows for the Read-Only property of a control:
|
Task |
Script |
|---|---|
|
return true; |
|
return false; |
To allow or deny a user to enter a value for a control based on the value of another control
You can allow or deny a user to enter a value for a control based on the value of another control.
Example
If you want to deny a user to change the value in the Comments (T1) control when the Edit Comments (D1) control is set to No (here the value for No is 0 and the value for Yes is 1), then you can code the script for the Read-Only property of the Comments (T1) control as follows.
if(control.findById("D1").value !== "1")
{
return true;
}
else
{
return false;
}
Note:
- The currentValue method returns the value for the current property of a control.
- For the Read-Only property, the value is true when the control is only viewable and the value is false
when the control is editable.