<input type="image"标签引发的页面提交!
2016-04-23 11:42
507 查看
<input type="image"标签引发的页面提交!
![](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
转载▼
最近遇到了一个问题,通过OPEN方式打开后一个窗口又关闭后,调用窗体总是自动提交。
调了半天代码,试了几种情况,发现竟然是<input type="image"搞的鬼,美工直接从别的系统上扒下来的页面,也没注意,被这个问题困扰了半天时间。
主要原因是使用了<input type="image",而且放在了<form中。
<input type="image"标签类似<input type="submit",只要放在form中,执行该按钮就会提交页面。
解决方法:
1、不使用<input type="image"标签;
2、在onclick 事件中添加一段“;return false;”的脚本,如下:<input type="image" name="imageField1" id="imageField1" src="../imp/_img_files/search.gif" onclick="openTestList();return false;">
相关文章推荐
- ScrollTo:平滑滚动到页面指定位置,源码下载
- 8086 汇编
- Java中的static的使用指南
- 16、Map-Hashmap
- github使用
- juniper 550M訪问自身公网IP回流内部IP
- 日期选择插件clndr的使用
- Codeforces Gym 100889 A. A Beautiful Array
- start.S解析9
- Android 开发 Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure th
- python爬虫——基于selenium用火狐模拟登陆爬搜索关键词的微博
- C++ 效率
- statusbar 更换图标UI 续
- Java中的查找算法之顺序查找(Sequential Search)
- kubernetes源码分析 -- kube-proxy
- JAVA GridBagLayout布局
- iOS中时间与时间戳的转换
- Android JPush(极光推送)的使用教程
- 机房水题欢乐赛 2016-04-20 下午
- c语言.野指针