xlh : { validators : { trigger : 'change', notEmpty : { message : '序列號不能為空' }, threshold : 15,// 有15字符以上才發送ajax請求 remote : {// ajax驗證。server result:{"valid",true or false} url : appPath + "/app/chanpin/check/", message : '該條形碼已經存在', delay : 500,// ajax刷新的時間是1秒一次 type : 'POST', // 自定義提交數據,默認值提交當前input value data : function(validator) { return { userName : $("input[name=userName]").val(), method : "checkUserName"// 判斷調用方法關鍵字。 }; } } } }