从表单中的突出先提交按钮停止IE [英] Stopping IE from highlighting the first submit-button in a form

查看:104
本文介绍了从表单中的突出先提交按钮停止IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在表单中输入的预期的行为似乎在 HTML 4.01规范而HTML 5规范的says它应该是在窗体中的第一个提交按钮。

The expected behaviour on enter in a form seems to be undefined in the HTML 4.01 Specification while the HTML 5 specification says it should be the first submit button in the form.

的Internet Explorer(IE)突出的时候,表单集中加入了专有的边界或什么形式的第一个按钮。其他浏览器不添加这样的视觉线索。

Internet Explorer (IE) highlights the first button in the form when the form has focus by adding a proprietary border or something. Other browsers do not add such a visual clue.

我想用另一个按钮默认和风格这个按钮,这样所有的浏览器将提供一个视觉线索,这是默认的按钮。 (我们使用它使用每页一个ASP.NET的形式,所以很难设计网页,使默认按钮永远是第一位的。)

I'd like to use another button as the default and style this button so all browsers will provide a visual clue that it is the default button. (We're using ASP.NET which uses one form per page, and so it's hard to design the pages so that the default button always comes first.)

虽然我可以用JavaScript和CSS在大多数浏览器轻松地做到这一点,我有麻烦让IE停止凸显的第一个按钮。

While I can easily accomplish this with javascript and css in most browsers, I'm having trouble making IE stop highlighting the first button.

有没有办法告诉IE浏览器没有突出的第一个提交按钮或突出显示不同的按钮?或者是有,我已经错过了一些其他的解决办法?

Is there any way to tell IE to NOT highlight the first submit-button or to highlight a different button? Or is there some other solution that I've missed?

推荐答案

在您的asp.net按钮控制,设置 useSubmitBehavior =FALSE。这呈现HTML作为一个按钮,而不是提交。

On your asp.net button control, set useSubmitBehavior="false". That renders the html as a button rather than a submit.

这篇关于从表单中的突出先提交按钮停止IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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