您的位置:首页 > 其它

dwr传递form表单

2015-10-15 12:01 375 查看
1.jsp

<form name="detailForm">
<input type="hidden" name="accountApprove.basicInfoId" id="detailBasicInfoIdHid">
<input type="hidden" name='accountApproveForm.remark' id="detailRemarkIdHid">

    <input type="hidden" name="detailFlag" id="flagId" value="">

    <input type="hidden" name="comnum" value="<%=request.getSession().getAttribute("COMNUM")%>" id="comnumIdHid">

    <input type="hidden" name="approveComnum" id="approveComnumIdHid">

    </form>

2.ajax传递form

if (typeof window['DWRUtil'] == 'undefined')  window.DWRUtil = dwr.util;
var detailForm=DWRUtil.getValues("detailForm");

accountApproveAjax.approveAccount(detailForm,{callback:function(resultInfo){
var resultFlag=(resultInfo.errCode);
alert(resultInfo.errMsg);
//清除审批页面信息,加载待审批列表页面
var detailDiv=document.getElementById("baoxiaoShenpiDetail");
detailDiv.innerHTML="";
document.getElementById("loadingDiv").style.cssText="display:block;text-align:center;";
accountApproveListPageSet();

}});

3.java后台获取form表单内容

public ResultInfo approveAccount(Map formMap){
MultivaluedMap formData = new MultivaluedMapImpl();
String basicInfoIdStr=(String)formMap.get("accountApprove.basicInfoId");
String remark=(String)formMap.get("accountApproveForm.remark");
String flag=(String) formMap.get("detailFlag");}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: