With CaptainForm – WordPress Form Builder – you can add field validation on your WordPress forms. Field Validation determines the type of input accepted in the field, and allows you to accept only the data that meets your required format.
You can choose from predefined validation types or create custom validation codes. The predefined types are:
- alpha – only letters
- alphanumeric – letters and digits
- alphaspace – letters and white spaces
- alphanumericspace – letters, digits and white spaces
- numeric – only digits
- numericplus – digits and the characters +, -, .
- email – email addresses
- URL (webpage) – webpage URLs (e.g. https://www.captainform.com/docs/)
- date – YYYYMMDD – date as year/month/day
- date – DDMMYYYY – date as day/month/year
- date – MMDDYYYY – date as month/day year
- date – MMDDYYYY + picker – date as month/day/year and a calendar in which users can pick the date instead of typing it in
- date – DDMMYYYY + picker – date as day/month/year and a calendar in which users can pick the date instead of typing it in
- date – MMYYYY – date as month/year
- time – time coordinates (hours and minutes)
- custom
With custom validation, you can define your own validation code. Choose Custom in the validation dropdown list and type your code in the box that shows up. The code will have a format such as CCCNNUAAANN. The code letters that you may use are:
- C – character (letter)
- N – numeric (digit)
- A – alphanumeric (letter or digit)
- L – lowercase letter
- U – uppercase letter
- S – white space
That’s it! With this feature, you will never receive emails that you can’t answer because the user misspelled the email address, nor will you receive phone numbers containing unwanted letters, entered by mistake.