Canvas enables the developer to mark the item as mandatory or conditional mandatory enabling the developer to effectively handle user input.
Mandatory Text | ConditionalMandatory Text |
The Mandatory Text indicates that an item is mandatory. The end-users must enter the values for those items marked with Required Indicators. | The Conditional Mandatory Text indicates that an item is conditionally mandatory. The users will have to enter values based on a condition. |
...
Code Block | ||
---|---|---|
| ||
this.fm.registerHandler("cbxprevalidate", function(fm, config) { //fm.getValue API is used to get the value of particular field. if(fm.getValue("CHK_PROCEED_WOUT_MESG")=='Y') { //This API is used to marks a invalid field as Valid. fm.clearInvalid("TXT_MESSAGE_DESC"); return [true, true]; } else { //This API is used to marks a invalid field as Valid. fm.markInvalid("TXT_MESSAGE_DESC", "Please, Enter the message"); return false; } }); |
For more details of form APIs, see Form and Form Item APIs.