關於JQuery的Validation外掛程式中Remote驗證的中文問題

來源:互聯網
上載者:User
contenttype: "application/x-www-form-urlencoded; charset=utf-8",

加入到ajax請求的參數中,結果這次居然不起作用了。

多次觀察fiddler結果,發現無效後,只好開啟jquery.validation.網頁特效尋求答案了。

在remote的代碼中,我發現:

 

...

var data = {};
data[element.name] = value;
$.ajax($.extend(true, {
url: param,
mode: "abort",
port: "validate" + element.name,
datatype: "網頁特效on",
data: data,


....


為了防止validation外掛程式對輸入資料的處理,我試著採用自己的option來覆蓋validation的option定義:

複製代碼 代碼如下:

remote: {
url: "ajax.asp教程x?a=xxx",
type: "post",
datatype: "json",
contenttype: "application/x-www-form-urlencoded; charset=utf-8",
data: { txt1: function() { return $("#txt1").val(); } }
}

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.