后端使用SpringMVC,前端执行新增操作出问题:
TypeError: $.fn.form.methods[_3de] is not a function
js代码如下:
function saveAdd(){
$.messager.confirm('提示', '您确认要提交吗?', function(r) {
if (!r) {
return;
}
$('#wangdianAddForm').form('submit', {
onSubmit : function() {
return $(this).form('enableValidation').form('validate');
}
});
var gsmc = $("#gsmc").textbox("getValue");
var xsddm = $("#xsddm").textbox("getValue");
var xsdmc = $("#xsdmc").textbox("getValue");
var wdmc = $("#wdmc").textbox("getValue");
var wdno = $ ("#wdno").textbox("getValue");
var wdlx = $("#wdlx").textbox("getValue");
var wdlb = $("#wdlb").textbox("getValue");
var qydm = $("#qydm").textbox("getValue");
var qy = $("#qy").textbox("getValue");
var sfen = $ ("#sfen").textbox("getValue");
var cshi = $("#cshi").textbox("getValue");
var xian = $("#xian").textbox("getValue");
var xzhen = $ ("#xzhen").textbox("getValue");
var dizhi = $ ("#dizhi").textbox("getValue");
var zmdbh = $ ("#zmdbh").textbox("getValue");
var dmxz = $ ("#dmxz").textbox("getValue");
var zmdgm = $("#zmdgm").textbox("getValue");
var zspl = $("#zspl").textbox("getValue");
var jdsj = $("#jdsj").datebox("getValue");
var qczx = $("#qczx").datebox("getValue");
var zxzx = $("#zxzx").datebox("getValue");
var yb = $("#yb").textbox("getValue");
var sccj = $("#sccj").textbox("getValue");
var xsgsfy = $("#xsgsfy").textbox("getValue");
var jsxfy =$("#jsxfy").textbox("getValue");
var fzren = $("#fzren").textbox("getValue");
var bgdh = $("#bgdh").textbox("getValue");
var fzrmobile = $("#fzrmobile").textbox("getValue");
var zxfg = $("#zxfg").textbox("getValue");
var gznr = $("#gznr").textbox("getValue");
var xsry = $ ("#xsry").textbox("getValue");
var shry = $("#shry").textbox("getValue");
var qtry = $("#qtry").textbox("getValue");
var dmmj = $("#dmmj").textbox("getValue");
var bgmj = $ ("#bgmj").textbox("getValue");
var ckmj = $("#ckmj").textbox("getValue");
var sq = $ ("#sq").textbox("getValue");
var zblj = $("#zblj").textbox("getValue");
var czren = $("#czren").textbox("getValue");
var czrmc = $ ("czrmc").textbox("getValue");
var zjczren = $("#zjczren").textbox("getValue");
var zjczrmc = $("#zjczrmc").textbox("getValue");
var wangdian = {
"gsmc":gsmc,
"xsddm":xsddm,
"xsdmc":xsdmc,
"wdmc":wdmc,
"wdno":wdno,
"wdlx": wdlx,
"wdlb": wdlb,
"qydm": qydm,
"qy": qy,
"sfen": sfen,
"cshi":cshi,
"xian":xian,
"xzhen":xzhen,
"dizhi":dizhi,
"zmdbh":zmdbh,
"dmxz": dmxz,
"zmdgm": zmdgm,
"zspl":zspl,
"jdsj":jdsj,
"qczx":qczx,
"zxzx":zxzx,
"yb":yb,
"sccj":sccj,
"xsgsfy":xsgsfy,
"jxsfy":jxsfy,
"fzren":fzren,
"bgdh":bgdh,
"fzrmobile":fzrmobile,
"zxfg":zxfg,
"gznr":gznr,
"xsry":xsry,
"shry":shry,
"qtry":qtry,
"dmmj":dmmj,
"bgmj":bgmj,
"ckmj":ckmj,
"sq":sq,
"zblj":zblj,
"czren":czren,
"czrmc":czrmc,
"zjczren": zjczren,
"zjczrmc":zjczrmc,
};
$.ajax({
type : "POST",
url : "wangdianadd.do",
data : wangdian,
dataType : "json",
success : function(data) {
if (1 == data.result) {
$.messager.alert("操作提示", data.msg, 'info');
$("#dlg").dialog('close');
$("#wangdianAdd_dg").datagrid("reload");
} else {
$.messager.alert("操作提示", data.msg, 'info');
}
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.messager.alert("操作提示", XMLHttpRequest.status + ":"
+ XMLHttpRequest.responseText, 'info');
}
});
});
}
是Jquery.js的问题还是我的代码的问题。