一个表单两个提交按钮交付不同页面

WBOY
Release: 2016-06-13 11:57:53
Original
919 people have browsed it

一个表单两个提交按钮提交不同页面

<br /><br /><form   method="get" name="myForm" action="test5.php" ><br /><table ><br />	<tr ><td>查询起始时间:<input type="datetime-local" name="start"/></td></tr><br />	<tr ><td>查询截止时间:<input type="datetime-local" name="end"/></td></tr><br />	<tr ><td><input type="submit" name="chaxun"  value="查询"  />  //查询按钮提交给test5.php<br /> 	<input type="button" name="down"  value="导出xls文件"  /> </td>       //导出xls文件按钮提交给down.php<br />         </tr><br /></table><br /></form><br /><br />初学,试了几种方法都不行,就只有action提交给哪个页面,哪个页面可以成功,求高手赐教<br /><br />
Copy after login



------解决方案--------------------
在按钮 down 的 onclick 事件中修改表单的 action 属性和执行表单的 submit 方法
------解决方案--------------------
all 啊户型只有 ie 支持
说以应该是
<input type="button" name="down" value="导出xls文件" onclick="down(this.form)" />
Copy after login
<br />function down(form) {<br />   form.action = "down.php";<br />   form.submit();<br />}
Copy after login

------解决方案--------------------
遇到类似的问题 。不用在一个同一个form标签写 。 在新建一个 
 
   
  
            //导出xls文件按钮提交给down.php         
  
 
 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!