Home  >  Article  >  Web Front-end  >  单行文本框怎样才能不回车自动提交?_html/css_WEB-ITnose

单行文本框怎样才能不回车自动提交?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:43:301236browse

html 文本框 网页 表单

我用的

这样的单行文本框,当光标在文本框中的时候点回车就会自动提交表单,目前只发现在表单域中增加一个才能取消text的回车提交,但是我的表单域中又不需要密码框...
怎样才能使得text不回车提交呢?

回复讨论(解决方案)

给文本框加入onblur事件,调用提交方法

终于用onKeyDown="if(event.keyCode==13)event.returnValue=false"解决了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn