Home > Web Front-end > HTML Tutorial > <input type="text"> 只能输入英文_html/css_WEB-ITnose

<input type="text"> 只能输入英文_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-21 08:55:02
Original
1214 people have browsed it

如何让  只能输入英文


回复讨论(解决方案)

JQuery 在onChange事件中判断处理

var val='汉字111';
var regName =/^[a-zA-Z]+$/;
if(regName .test(val)){alert('只能输入英文');}


onChange中,   判断是否为英文,如果不是直接返回就行。

结合2楼和3楼的就好了

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