Mandatory
- Last UpdatedJun 25, 2024
- 1 minute read
Use scripts for the Mandatory property to enforce or bypass entering a value for a control.
To enforce or bypass entering a value for a control
-
Code the script as follows for the Mandatory property of a control:
|
Task |
Script |
|---|---|
|
return true; |
|
return false; |
To enforce or bypass entering a value for a control based on the value of another control
You can enforce or bypass entering a value for a control based on the value of another control.
Example
If you want to enforce entering a value for the Last Name (T2) control when a name is entered in the First Name (T1) control, then you can code the script for the Mandatory property of the Last Name (T2) control as follows:
if(control.findById("T1").value !== "")
{
return true;
}
else
{
return false;
}
Note:
- The currentValue method returns the value for the current property of a control.
- For the Mandatory property, the value is true when the control is enforced and the value is false when
the control is bypassed.