When it comes to forms, it is usually important to ensure that the correct type of information is collected in each form field. In InfoPath, fields can be configured to be required or to only allow certain types of information, such as numbers. In addition, we can use validation rules to ensure the data entered meets the specified requirements, such as being a number greater than the number entered into the previous field.
In this recipe, we will create a required field that only allows whole numbers between 10 and 20.
Follow these steps to create a required field with a validation rule:
Between 10 and 20
.Value Must be Between 10 and 20
.When data in a field does not meet the requirements specified, we can prevent the form from being submitted. This allows the user to correct the information before submitting it again. These requirements are enforced using validation rules in the InfoPath engine. The Cannot be blank option makes the field required. The Condition for a validation rule may be quite complex. Custom formulas can be used, the conditions can vary depending upon the values of other fields, and so on. In this recipe, we simply ensured that our field is not empty and that it has a value between 10 and 20.
3.145.87.161