如何避免Internet Explorer的第一次按钮选择? [英] How to avoid internet explorer first button selection?

查看:209
本文介绍了如何避免Internet Explorer的第一次按钮选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个文本字段和一个按钮的表单。当我输入其中一个文本字段,提交按钮变得突出显示,如果我在输入时按下,按钮被按下,所以我有一个未预期的行为,因为我的页面提交。 Firefox不会这样做。

有没有一些属性或配置来避免这种不希望的行为或者我必须使用一些javascript技术?

I have one form with several text fields and one button. When i enter one of the text fields, the submit button become highlighted and if i press enter while typing, the button is pressed, so i got an unexpecte behaviour because my page is submitted. Firefox doesn't act such a way.
Is there some attribute or configuration to avoid this undesired behaviour or i have to use some javascript technique?

推荐答案

通常我在这种情况下做的是使表单上的第一个按钮不做任何事情,然后用CSS隐藏它。 Kludgy?当然。有效?绝对。

Generally what I do in this situation is make the first button on the form do nothing and then hide it with CSS. Kludgy? Sure. Effective? Absolutely.

事实上,这是一个重复的停止IE从表单中突出显示第一个提交按钮

In fact, this is a duplicate of Stopping IE from highlighting the first submit-button in a form.

这篇关于如何避免Internet Explorer的第一次按钮选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆