问题描述
我有两个按钮的形式。首先是使用Javascript隐藏的。
I have a form with two buttons. The first is hidden using Javascript.
当我preSS在IE中输入文本框,表格不提交。我想这是因为它选择的第一个按钮为默认提交按钮,但由于该按钮被隐藏它不工作。
When I press enter in a textfield in IE, the form does not submit. I assume it is because it has chosen the first button as default submit button, but since that button is hidden it does not work.
我已经提交上输入的keydown事件的Javascript的形式解决了这个。然而,这也提交表单,如果用户presses输入选择从浏览器的自动完成下拉列表中的项目。
I have solved this by submitting the form on an enter keydown Javascript event. However, this also submits the form if the user presses enter to select an item from the browser's autocomplete dropdown.
我如何提交在IE中输入的形式,而不会干扰自动填充功能?
How do I submit the form on enter in IE, without disturbing the autocomplete functionality?
推荐答案
我们在几年前也有类似的问题,AFAIR,我们增加了一个的其他的按钮形式的开始,这始终执行时输入的默认提交操作是在IE pssed $ p $。该按钮可以几乎隐藏给它一个1x1透明图像。
We had a similar problem a few years ago, and AFAIR, we added an additional button to the beginning of the form, which always performs the default submit action when enter is pressed in IE. That button can be "almost hidden" by giving it a 1x1 transparent image.
这篇关于进入并不在IE提交,因为隐藏式按键的形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!