RedAngel 发表于 2012-12-22 21:24:16

form submit提交遇到的问题

<div id="cnblogs_post_body">因为公司业务需要,有一个提交的功能,提交的时候要上传文件,后端是用JAVA写的。用的是Form表单手动提交方式,如果用IE后台不到任何数据,firefox是可以的,但是不管是IE还是firefox,后台请求都会打开一个新的空白页面(速度很快时firefox看不出来)。而我想要的功能是提交完后就把当前页面关闭了,而不是打开一个新的空白页面。
下面是html代码,当然经过我修改过的,把出错的情况和正确的都列出来了,submit1和submit2
<div class="cnblogs_code"> 1 <!DOCTYPE html> 2 <html> 3 <body> 4 <formid="frmChild" enctype="multipart/form-data" onsubmit="return checkForm();"> 5<input id="txtLocation"name="locationvalue" type="file" size="50"/> 6<textarea cols="50" rows="5" id="comment" name="comment"></textarea> 7 <input type="submit" name="submit" value="submit1"/> 8 <button type="button" onclick="operator()">submit2</button> 9 </form>10 </body>11 </html>
页: [1]
查看完整版本: form submit提交遇到的问题