Validate form fields in Patron Edge Online
Patron Edge Online can be a double-edged sword when it comes to data entry. A user has the ability to enter his own address and phone information so that you don't have to try to track it down elsewhere later on, but when you don't enforce any kind of formatting standard, searching or reporting on it in the system can become a pain. Luckily PEO has a built-in feature that allows you to validate form fields using something called a regular expression. If that phrase means nothing to you, don't worry. We have a regular expression builder that will walk you through it. If you are familiar with JavaScript regular expressions, you can write them manually and bypass the builder tool.
Regular expressions are a great way to test for valid phone and email formatting, so be sure to take a few minutes this week and set up a few. To illustrate how to use the builder, here is an example that forces Email to have an @ symbol and at least one period.
- Go to Administration, System Setup, User-Fields Rules
- Edit the row for Email
- Click the regular expression builder button beside Regular Exp 1
- From the Begins with drop-down list, select 'any char' that occurs 'once or many'
- In the Followed By section, select 'the char', enter the @ symbol, and select occurs 'once'. Then click Add
- Change Followed By to 'any char' that occurs 'once or many' and click Add
- Change Followed By again to 'the char', enter a period and select occurs 'once'. Click Add again
- In the Ends With section, select 'any char' occurs 'once or many'
- To test, enter various combinations of values in the Validate field and
click Validate. An alert box will tell if the values pass the rule or not.
- When finished, click OK.
If you are familiar with creating regular expressions, you can type directly into the Regular Exp 1 field and skip the builder. In the above example, you can type
the expression ^.+@.+\..+$ directly into the field. Advanced users note: the regular expression field
does not support the Replace or Split methods, only the Test method.
What other regular expressions are you using to keep your data in a nice, clean format? Leave a note in the comments.