How to Validate a Custom Moodle Form

Within your form class add the following function

It woud look something like this:

validation_function_form_moodle