If Country.IsBlank Then
PostalCode.ApplyEditMask("99999")
ElseIf Country.Value = "CANADA" Then
PostalCode.ApplyEditMask("A9A9A9")
End If
- Draw a text zone around the Postal Code field and name the PostalCode.
- Draw a text zone around the Country field and name the field Country.
-
Indicate that each zone is handprint and assign the correct number of character constraint boxes for each zone (Parameters Toolbox button | Recognition Parameters | Print Type tab).
- Select Parameters Toolbox button | Rules Parameters, then click the postal code zone.
-
Click the VBScript tab | Post Extraction button to access the VBScript window.
-
Enter the following code in the main VBscript window:
If Country.IsBlank Then
PostalCode.ApplyEditMask("99999")
ElseIf Country.Value = "CANADA" Then
PostalCode.ApplyEditMask("A9A9A9")
End If
- Click the Syntax Check button to identify any syntax errors in the script. "Successfully Compiled!” appears at the bottom of the window.
-
Click OK in both the VBScript Editor and Rules Parameters window.
You now have created a conditionally implemented Edit Mask. If the Country zone is not blank, then the Edit Mask is A9A9A9 to constrain the zone data.