2011-01-20 54 views
5

我想只有errror消息字符串的字符串,jQuery驗證插件,得到錯誤

('#frmEcard').validate({ 
     onkeyup: false, 
     onfocusout: false, 
     onsubmit: false, 
     ignoreTitle: true, 
     rules: { 
      'txt_sendto': "multiEmails", 
      'txt_subject': { 
       maxlength: 255 
      }, 
      'txt_message': { 
       maxlength: 500 
      } 
     }, 

     errorPlacement: function(error, element) { 
      $.jGrowl(HERE , { 
       sticky: true, 
       life: 12000      
      }); 
     } 
    }); 

回答

5

在這裏你去。

errorPlacement: function(error, element) { 
      $.jGrowl($(error).text(), { 
       sticky: true, 
       life: 12000      
      }); 
     } 
+0

這就是我會做的。如果沒有,請將變量設置爲('#frmEcard')。validate(),然後遍歷錯誤對象並將消息拉出。用螢火蟲看看它的樣子。 – IEnumerator 2011-01-20 15:38:55