Home > Web Front-end > JS Tutorial > Validate uppercase letters, numbers and Chinese in javascript_javascript skills

Validate uppercase letters, numbers and Chinese in javascript_javascript skills

WBOY
Release: 2016-05-16 17:03:47
Original
1506 people have browsed it
Copy code The code is as follows:

var reg = /^[u4E00-u9FA5] $/; // Verify Chinese
var cp=$("input[name='cpid']").val();
for(var i=0;ivar cpp =cp.charAt(i);
if(!reg.test(cpp)||cpp.match(/^([A-Z]) $/)||cpp.match(/^d $/)){ //Verify uppercase letters, numbers and Chinese
document.getElementById("div2").style.display="block";
document.getElementById("div2").style.color="red";
$("#div2").text("*Must enter all lowercase letters!!!");
// return false;
}
Related labels:
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