Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Input rules are a JSON encoded associative array of input validation rules. They allow you to specify how each field should be validated against errors on input. For additional details on input rules see Error Checking. Let's take a look at an example:

Code Block
titleExample Input Rules
{"service_field_1":{
	"valid":{
		"rule":"isEmpty",
		"negate":true,
		"message":"Service Field 1 must not be empty"
	}
}}

In the above example we're validating the service_field_1 field using the isEmpty rule and negating it using the negate attribute. This ensures that the service_field_1 field is not empty when submitted. If it is empty a Service Field 1 must not be empty error will be displayed.