Chapter 3. Moodle Forms Validation
In this chapter, we will cover:
Adding a required field
Adding a field with a maximum length
Adding a field with a minimum length
Adding a field length within a specified range
Adding a valid e-mail address field
Adding custom validation with a Regular Expression
Adding a field that accepts only alphabetic characters
Adding a field that accepts only alphanumeric characters
Adding a field that accepts only numeric characters
Rejecting punctuation characters
Rejecting input without a leading zero
Comparing with another field
Adding a custom JavaScript validation function callback