Server side validation not working

van Ginneken 07 Oct, 2014
I have a simple form which allows users to submit an email address to receive an email. Two emails are sent out: one to the address entered and one to a fixed address, containing the address entered. I've set up server side validation to stop submissions with an empty email address. However, it does not seem to be working. Aside from the server side validation, the form is working. The email address is stored in the variable Email. I've tried various things, with {Email} between braces, with a newline following. without a newline, put it in the "Not Empty" box.... nothing works. What am I doing wrong?
GreyHead 07 Oct, 2014
Answer
1 Likes
Hi van Ginneken,

The syntax in CFv5 is different - it is shown in the help message under the Not empty box: "Multi lines of fields names and error messages, e.g: field_name:This field should not be empty....etc"

You need something like this:
Email:Your Email is required

Bob
van Ginneken 07 Oct, 2014
OK, thanks. I missed that hint under the No empty box. It appears that it doesn't accept a space between Email and the colon, but otherwise it works. I also had to set AJAX submit to No to see the error message.
GreyHead 07 Oct, 2014
Hi van Ginneken,

As a general observation with ChronoForms you should omit spaces unless they are specifically requested (I can't think of any examples of that off hand), The code could perhaps be a bit cleverer in trimming off unwanted spaces but I suspect that isn't at the to of Max's ToDo list.

I'm afraid that I don't know how or if the Ajax submission works with Serverside validation :-( I must take a look when I have a moment.

Bob
This topic is locked and no more replies can be posted.