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

WBOY
Release: 2016-06-21 09:43:30
Original
1242 people have browsed it

html 文本框 网页 表单

我用的

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

回复讨论(解决方案)

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

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!