Default error message for MaxLength validation

212 views
Skip to first unread message

Dan G. Switzer, II

unread,
Jul 7, 2011, 8:27:08 AM7/7/11
to ValidateThis-dev
The default error message for the "MaxLength" client-side rule is:

"Please enter no more than {maxLength} characters."

The problem is the message doesn't contain a reference to *which*
field generated the error message. Every validation method should at
least reference the field responsible for the throwing the error.

Also, it would be really great if the default error messages were
stored in one config file that you could easily overwrite.

Bob Silverberg

unread,
Jul 7, 2011, 9:13:23 AM7/7/11
to validate...@googlegroups.com
Is that MaxLength default message being created by VT or is it just using the default from the jQuery validation plugin? Originally most of the client-side vals just used the jQuery plugin defaults, and if I recall correctly the jQuery plugin does not state which field, so maybe that's at the root of this issue.

I think it makes sense to revisit all of the client-side default messages and generate our own, rather than using the plugin's default.  I also agree that having the default messages in one location would make sense.

Please feel free to add issues to the issue tracker for both of these items.

Thanks,
Bob


--
You received this message because you are subscribed to the Google Groups "ValidateThis-dev" group.
To post to this group, send email to validate...@googlegroups.com.
To unsubscribe from this group, send email to validatethis-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/validatethis-dev?hl=en.




--
Bob Silverberg
www.silverwareconsulting.com

Dan G. Switzer, II

unread,
Jul 7, 2011, 11:41:05 AM7/7/11
to validate...@googlegroups.com
Bob,

I'm not sure if it's the jQuery validation default message or not--I stopped digging at the source when I wrote the messages. I just assumed the messages would be the same for both client & server side (at least that's what would make sense to me.)

I'll create issues on GitHub.

-Dan
http://blog.pengoworks.com/

█▀▀▀▀▀█ ▄▀ ▄█▄▄█  █▀▀▀▀▀█
█ ███ █ ▀███▀ █▀  █ ███ █
█ ▀▀▀ █ █▄ ▄  ▀██ █ ▀▀▀ █
▀▀▀▀▀▀▀ █▄▀ █ █ ▀ ▀▀▀▀▀▀▀
█▀▄█▄▄▀▀  █▄▀██ █▄█▀▀ ▀▀▄
 ▄▀█▄▀▀▀▄▀▀▄▄▄█ ▄█▄▀▀  ▀▀
▀▀▄▄▀▀▀▀█▄▄▀▀█ ▀▀██▄ █▄▀█
▀▄ ▄▀ ▀  ▀▀█▄█▄▄▄ █▄▀▄▀▄▀
▀▀ ▀▀ ▀ █▀ ██▄ ▄█▀▀▀███ ▄
█▀▀▀▀▀█ ▀▄█ ▄▀█▀█ ▀ █▄▄▀█
█ ███ █ ▄▀▀ █▀ ▄▀█▀██ ▄▀ 
█ ▀▀▀ █ ▄ █▄ ▄▄ ▄▄▄ ▀█▀ ▀
▀▀▀▀▀▀▀ ▀▀  ▀▀ ▀▀  ▀   ▀▀

Reply all
Reply to author
Forward
0 new messages