Woohoo! That was easy enough. Thanks a ton for this amazing plugin. I'm sad
that this is the first time I've used it.

  _____  

From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Jörn Zaefferer
Sent: Monday, March 23, 2009 5:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Validation plugin: combine functions with strings on
remote error


Passing a function as a message happens all the time when using
$.format("... {0}") as messages. The function is expected to return the
formated message, so you can just return the string value you want to
display at the end of your function.

Jörn


On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews <amatth...@dealerskins.com>
wrote:



I'm using the validation plugin to validate a field remotely. The validation
portion works great, but I've got a question about the error message if the
validation fails.

I discovered that you can pass a function rather than a plain string as seen
below in the remote key. The problem is that when I do this, I lose the
ability to display a string of my choosing. Does anyone know how to
accomplish both?

messages: {
       pagealias: {
               required: 'Page alias is required',
               remote: function(){
                       // highlight the field
                       $field.pulse();
                       // display message
                       'This page alias is already in use'
               }
       }
}


Andy Matthews
Senior Web Developer

www.dealerskins.com

P Please consider the environment before printing this e-mail.

Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with
the service I have provided, please let me know right away so I can correct
the problem,
or notify my manager Aaron West at aw...@dealerskins.com.




Reply via email to