2

I have additional fields I check for in the onBeforeSaveUser event and add the errors to the errors array. The problem is my code doesnt even run if they miss the main fields or if the email is already in use or something like that... I would like to return ALL validation errors, not just the default field errors first.

If I go to my form and just press submit without filling anything it out it only complains about the username, email address and password. If I just fill those fields out, then it comes back and complains about all my other fields (a la my event handler). This is unexpected behavior. Am I doing something wrong or is there a way to address this?

1 Answer 1

1

I agree it's unexpected behavior, but for Craft 2 it won't change.

Craft 3 had a major overhaul of its event system and validation workflow where it works as you'd expect, though.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.