你现在所在的位置->首页->javascript->一个form里的内容提交到两个不同的页面
一个form里的内容提交到两个不同的页面
时间:[2005-8-11 18:58:06] 作者:少爷书房
假如有a.jsp,提交时能够同时提交到b.jsp和c.jsp,就是b.jsp和c.jsp中得到的内容是一样的。
---------------------------------------------------------------
document.form1.action=".../b.jsp";
document.form1.target="_self";
document.form1.submit();
document.form1.action=".../c.jsp";
document.form1.target="_self";
document.form1.submit();
---------------------------------------------------------------
document.all.form1.action = "a.jsp";
document.all.form1.target = "_blank";
document.all.form1.submit();
document.all.form1.action = "b.jsp";
document.all.form1.target = "_self";
document.all.form1.submit();
---------------------------------------------------------------
hhuzhj(阿金) :
a.jsp,b.jsp都提交给c.jsp,c.jsp可以接收到两个页面的值,简单举例就象多记录分页显示一样,点击下一页和上一页都是由一个页面处理,在处理逻辑上需要判断传送过来的值
如果上传file,最好用一个form提交
一个form同时提交给两个页面,好象不可以,不过可以由一个页面同时传值给多个页面,传值方式有很多种,根据需要选择
实现方式不妨这样考虑:由form(假如在a.jsp中)提交给b.jsp,在b.jsp中可以getParameter();然后将这些Parameters and values 传递给c.jsp and d.jsp
---------------------------------------------------------------
document.form1.action=".../b.jsp";
document.form1.target="_self";
document.form1.submit();
document.form1.action=".../c.jsp";
document.form1.target="_self";
document.form1.submit();
---------------------------------------------------------------
document.all.form1.action = "a.jsp";
document.all.form1.target = "_blank";
document.all.form1.submit();
document.all.form1.action = "b.jsp";
document.all.form1.target = "_self";
document.all.form1.submit();
---------------------------------------------------------------
hhuzhj(阿金) :
a.jsp,b.jsp都提交给c.jsp,c.jsp可以接收到两个页面的值,简单举例就象多记录分页显示一样,点击下一页和上一页都是由一个页面处理,在处理逻辑上需要判断传送过来的值
如果上传file,最好用一个form提交
一个form同时提交给两个页面,好象不可以,不过可以由一个页面同时传值给多个页面,传值方式有很多种,根据需要选择
实现方式不妨这样考虑:由form(假如在a.jsp中)提交给b.jsp,在b.jsp中可以getParameter();然后将这些Parameters and values 传递给c.jsp and d.jsp
【声明】本站刊载的《一个form里的内容提交到两个不同的页面》一文如果有侵害你权益的情况,请联系我们。我们将及时采取措施。
QQ:44637339 Email:just6@163.com Tel:13355163107 Lining studios