My form was called "Registration form" and validation was not working. I changed it to "Registration" and that fixed the problem.
I think it is because the form ID gets broken when the form name contains more than 1 word.
I think it is because the form ID gets broken when the form name contains more than 1 word.