I remade the entire form from scratch - now I have no more errors and everything works as expected - tested, if the code is not entered correctly the form does not send, if the code entered correctly it sends email. My code field is alphanumeric, so I added an alphanumeric validation instead of numeric, it still works.
Is there a way I can add a message next to the Code field that says Invalid code if the code entered does not match the code in the database after hitting submit? I have Form Toolkit but, not sure about the redirect page part of it.
Thanks you very much for your help.