Validate User Input
When working within an mrc application that allows end-users to input data, it is often necessary to be able to validate the user's input. In most cases, validation is usually necessary within a Maintenance application or the prompt page of a Report. mrc offers the following built in validation types for Maintenance templates (accessible via the Field Settings screen):
- Check to see if a value is in a specified hard-coded list if it is greater/less/equal than a field value.
- Check to see if a value is in a specified hard-coded list is in the range or not in the range of a field value.
- Check to see if a value is equal to blank.
- To create hard-coded drop-down lists, radio buttons, or check boxes.
Note: The above functionality is not available within Reports.
However, there are times when a more rigorous method of validation is necessary. For example, let's say that you need to validate that the user correctly enters both a starting date, an ending date, and that the dates are entered in the proper order. In these cases, validation can be controlled by an external object.
m-Power is designed so that you can use the language that you are most comfortable with to create your own external objects. The following documents explain how to use four popular languages to validate the scenario described above:
- Validating via an SQL External Object
- Validating via a Java External Object
- Validating via an RPG External Object
- Validating via JavaScript
Note: Each of the examples listed accomplish the same goal of validating for proper date input from the user.