<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">昨天在写一个form提交的时候,js代码没有什么问题,然后请求就是不能进入action,还来就反复折腾,最后看了帮助文档,才发现问题,原来easy ui的form提交必须啊在form标签中必须写上 </span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(255, 0, 0); background-color: rgb(255, 255, 255);">method="post"!method="post"!method="post"!</span><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">(重要的事说三遍!!!)才会好使。</span>
学习的不透彻啊!学的不透彻啊!学的不透彻啊!
<form id="formTT" method="post">
<input type="hidden" name="id" value="${userinfo.id}">
<table border='1' width="auto">
<tr>
<td>邮费:</td>
<td>
<input type="text" class="easyui-numberbox" value="${userinfo.post_price}" name="post_price"/>
</td>
</tr>
<tr>
<td>起邮价格:</td>
<td>
<input type="text" class="easyui-numberbox" value="${userinfo.post_price_m}" name="post_price_m"/>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="button" value="保存" id="btnSave">
</td>
</tr>
</table>
</form>
</body>
<script>
$('#btnSave').bind('click', function(){
save();
});
function save(){
$.messager.confirm('ConFirm','确定提交吗',function(r){
if(r){
$("#formTT").form("submit",{
url:"Tenants?type=updateTenants",
onSubmit: function(){
//校验
},
success:function(data){
if(data==1){
alert("保存成功");
}
}
});
}
});
}
</script>