I can't get any validation messages other than "This is a required field."
I'm trying to set up an isNumber field.
This is the FormIt snippet:
[[!FormIt?
&hooks=`spam,email`
&emailTpl=`zafEmailChunk`
&emailTo=`[email protected]`
&validate=`name:required,
phone-no:isNumber`
]]
I tried adding a custom error message:
[[!FormIt?
&hooks=`spam,email`
&emailTpl=`zafEmailChunk`
&emailTo=`[email protected]`
&phone-no.vTextIsNumber=`Phone number must be a number.`
&validate=`name:required,
phone-no:isNumber`
]]
-
- 5,888 Posts
nothing, what looks wrong there.
Just a guess:
perhaps it doesn't like the minus in 'phone-no'
Nope. Still just get the "this field is required" message. As far as I can tell, the isNumber validator isn't working at all.
Ahah! I got it to say "this field must be a valid number"
-
- 1,154 Posts
Could you enlighten the rest of us pls?
I am having a similar problem where, when a user tries to register with a taken user name, but gets no error message, people will be so confused, indeed all error messages are not working in that snippet now. I do have lots of notes to guide people, but this particular one will cause some frustration i am sure.
We are talking about FormIt here. As far as I know, it doesn't do any checking for usernames. You are probably thinking of the Login package's Register snippet. That I don't know about.
-
- 1,154 Posts
Ah, my mistake, I didn't realize.