网页中回车后form自动提交跳到其他页面的解决方法
摘要:网页回车后form自动提交,跑到其他页面有个查询的form,本来是希望点击查询时才查询的,结果测试到回车时跑到其他页面去了。...查询解决方...
网页回车后form自动提交,跑到其他页面
有个查询的form,本来是希望点击查询时才查询的,结果测试到回车时跑到其他页面去了。
<form action="notice.php" method="get">
...
<button type='button' onclick ="search_wj()">查询</button>
</form>
解决方法:
给form添加一个 onsubmit="search_wj();return false;"
<form action="notice.php" onsubmit="search_wj();return false;" method="get">
...
<button type='button' onclick ="search_wj()">查询</button>
</form>
【网页中回车后form自动提交跳到其他页面的解决方法】相关文章:
★ html与嵌入其中的flash均存在滚动条的情况分析及处理方法
★ HTML标签marquee实现滚动效果的简单方法(必看)