关于IE6链接标签href="javascript:void"不能提交表单的有关问题。
关于IE6链接标签href="javascript:void"不能提交表单的问题。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
IE6下href为javascript:void(0)不能提交表单,换成#的话,虽然可以提交表单,
但是如果验证不通过的话,滚动条会滚到顶层,怎样解决这种情况?
大家顺便来这帖子领分把。。
http://topic.****.net/u/20120427/10/2259919a-135d-47a5-a0cf-3f2ff388041f.html
------解决方案--------------------
用href="###"试试
IE6下href为javascript:void(0)不能提交表单,换成#的话,虽然可以提交表单,
但是如果验证不通过的话,滚动条会滚到顶层,怎样解决这种情况?
大家顺便来这帖子领分把。。
http://topic.****.net/u/20120427/10/2259919a-135d-47a5-a0cf-3f2ff388041f.html
- HTML code
<html> <head> <script> function test() { if(document.getElementById("name").value == '') return; document.getElementById("myform").submit(); } </script> </head> <body> <form id="myform" action="http://www.baidu.com"> <div style="height:1000px;"> IE6下href为javascript:void(0)不能提交表单,换成#的话,虽然可以提交表单, 但是如果验证不通过的话,滚动条会滚到顶层,怎样解决这种情况? </div> <input id="name"/><br/> <a href="javascript:void(0)" onclick="test()">IE6下不能提交表单</a><br/> <a href="#" onclick="test()">IE6下可以提交表单</a><br/> </form> </body> </html>
------解决方案--------------------
用href="###"试试