JQuery验证:自定义消息无效

时间:2010-07-26 18:28:04

标签: jquery-validate

      rules: {
        email           :   {
            required        :   true,
            email           :   true,
            remote: {
                    url: SITE_URL + 'index.php?sign_up/emailValidate',
                    type: "post",
                    data: {
                      email: function() {
                        return $("#email").val();
                      }
                    }
                  }

        }

      },
      message:{
           email:   {
                required        :   "Email cant be empty.",
                email           :   "Please enter a valid email",
                remote          :   "This email already exists."

            }
      }

1 个答案:

答案 0 :(得分:6)

您的代码中有拼写错误。您应该使用“消息”而不是“消息”。

messages:{
           email:   {
                required        :   "Email cant be empty.",
                email           :   "Please enter a valid email",
                remote          :   "This email already exists."

            }