js code that prohibits spaces in submitting form_javascript skills
WBOYOriginal
2016-05-16 17:14:501247browse
When I was working on a project, I used ckeditor on a page, but a problem arose. When I pressed the Enter key wherever there was a text box, it would automatically refresh. Finally, I found a solution:
function keydown(text){ $j(text).keydown(function(e){ if(e.which==13){ e.preventDefault(); } }); }
I use jquery. Because many times, we use event events, which are not compatible with other browsers, so we use jquery which Can be used across various browsers
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