2012-07-13 30 views
-3

這是我的驗證代碼如何使用jquery驗證的遠程方法?

​​3210
+0

您能否擴展您的問題? – hsz 2012-07-13 06:10:23

+0

phpinclude('lib1/config_global.php')的電子郵件可用性代碼; include('lib1/functions.php'); $ emailId = $ _REQUEST [「emailId」]; if($ emailId ==「[email protected]」){ echo「false」; } else { echo「true」; } – Sachin 2012-07-13 06:11:34

+0

它代碼正在工作。當我從數據庫中提取不工作 – Sachin 2012-07-13 06:12:43

回答

0

有jQuery的plugin頁面上的遠程方法很容易解釋。

根據我對你的建議!要更好地理解該方法,請使用中的方法展開表單。

emailId: { 
    required: true, 
    email: true, 
    remote: { 
     url: "checkmail.php", //the url of the page you are querying 
     type: "post", //the method you are going to use to send the data 
     data: { //the data you are going to send 
      email: function() { 
      return $("#email").val(); //send the value of email 
      } 
     } 
    } 
}, 

但是,您的代碼應該按照它的方式工作。

+0

其不工作 – Sachin 2012-07-13 06:35:30

+0

@Sachin,你已經將'$(「#emai」)''改爲你真實的郵箱地址 – Starx 2012-07-13 08:17:31