Versions Compared

Key

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

...

In the above example we're validating the hostname field using the isEmpty rule and negating it using the negate attribute. This ensures that the hostname field is not empty when submitted. If the rule validation fails (hostname is empty) the message we defined using the message attribute will be displayed to the user. We are also validating the password field at the same time using the matches rule, which evaluates a given regular expression. This rule requires that the password contain between 10 and 20 characters, inclusive, all of which must be characters of any combination from A through Z, upper or lower case, the digits 0 through 9, and the special characters $, %, and ^.

Note that special characters character literals like $, %, and ^ should be escaped where appropriate in the regular expression via double backslashes. Creating invalid regular expressions could will cause the field (or other fields) to pass validation when they otherwise should otherwise not.

Notifications

Notifications allow the universal module to post to a given URL or email a given address when a certain action occurs.

...