> > No, only one message per field can be defined. But that is a limitation
> > that seems to provide better usability anyway: It can be quite
> > frustrating to enter a value, get an error message, correct the value,
> > and getting a different error message. I think the better approach tells
> > the user what it expects with one message.
>
>
> In that case, I agree that rangeLength would have been a better option,
> but
> how about this:
>
> $("#myform").validate({
> rules: {
> firstname: { required: true },
> age: { number: true },
> password: { rangeLength: [5, 32] },
> email: {required: true, email: true}
> },
> messages {
> password: {
> rangeLength: "Please enter a password greater than {0} and less
> then {1} characters long",
> },
> email: {
> required: "Please enter your email address",
> email: "Your email address is not correctly formatted. It
> should
> look like [EMAIL PROTECTED]"
> }
> });
>
> With the email field, not entering anything and entering something that is
> not properly formatted are two completely different errors IMO, and thus
> deserve two different error messages describing exactly why the user's
> input
> was not accepted.
I don't think so: Why not just "Please enter your email address, something like
[EMAIL PROTECTED]"? That is applicable for both the required and the email rule.
If you can give me an example where it is an error to merge both messages into
one, I'd consider a multiple-messages-per-field feature.
--
Jörn Zaefferer
http://bassistance.de
--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/