表单多页面提交(查询及下载)

 

看UI

<form action="" name="">

<input type="submit" value="查询" />
<input type="button" id="down" value="下载" />

</form>

js:

$("#down").click(function () {
var form = document.forms[0];  //获取表单
var oldaction = form.action;      //获取老路径
form.action = "/zsgl/down";      //传递新路径
form.method = "post";             
form.target = "_blank";
form.submit();
form.action = oldaction;             //返回老路径
})

posted @ 2016-03-10 10:23  少时不知贵  阅读(236)  评论(0编辑  收藏  举报