Remote validation is a powerful feature that allows a field to be validated against a lookup query. For example, you can verify that a value entered by a customer, such as a coupon code, exists in a lookup table and is a valid code. Or, depending on your business requirements, you can prevent duplicates by verifying that an email address does not already exist in your forms database. You can also prevent duplicates by using form security options.
[Screencapture: Field Validation Setting, dropdown list showing Remote at the very end -- the options don't appear to be in any particular order so useful to show position in the list]
- In the Value column for Validation, choose Remote (Advanced) from the dropdown list. The Validation Config property appears below Validation.
- Click Validation Config. The Remote Validation Editor window appears.
- Define the validation using these values:
Property Details Rule Name Enter a meaningful name for this rule. Lookup Table Click and select the lookup table that contains the value you are validating against. Edit Rule
Click to Edit Rule and use the standard Logiforms Rule screen to select one or more fields and define the settings that determine when this validation will be run.
Use this field and the next to determine when to make the field invalid based on the number of returns from the lookup query. For example, for validation of a discount code recorded against a purchase, you may allow a maximum 3 uses.
Select the operator to use when comparing the number of records returned from the query. The default is Equal to. You can change to Not Equal to, Greater Than, Less Than.
Enter the value to use in the comparison. The default is 1.
For this example, if you only allowed 3 uses of the code you would select Less Than 4 in the Comparison Settings fields.
- Click Save.
- Optional. Consider adding a Custom Message if the field fails validation, to let the user know what went wrong.