2010-09-22 81 views

回答

7

你的腳本順序是相反的,包括jQuery的之前任何插件,像這樣:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> 
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js"></script> 

此外,由於我沒有看到任何衝突,我會繼續前進,並移動到jQuery的1.4得到最新的好處。

+1

我第二本。如果您曾經使用過需要jQuery(或其他任何庫)的腳本,請確保該腳本在腳本之前加載,以便可以訪問它。 – 2010-09-22 15:38:46

+0

謝謝,但它沒有奏效。我也嘗試1.4但沒有... – ziiweb 2010-09-22 15:43:41

0

我失敗了rule..This內部工作正常:

<script type="text/javascript"> 

$.validator.setDefaults({ 
    submitHandler: function() { alert("submitted!"); } 
}); 

$().ready(function() { 
    // validate signup form on keyup and submit 
    $("#jander").validate({ 
     rules: { 
      'sfApplyApply[email]': { 
       required: true, 
       email: true 
      } 
     }, 
     messages: { 
      'sfApplyApply[email]': "Please enter an email", 
     } 
    }); 
}); 

</script> 
相關問題