Home > front end >  How to limit input box can only input the Chinese
How to limit input box can only input the Chinese

Time:11-04

When submitting the form to the password input box is not allowed to type in Chinese, the type is text type, not the password type, how to limit, strives for the big help

CodePudding user response:

Var regExp=/^ [\ u4e00 - \ u9fa5] + $/;//\ u4e00 - \ u9fa5 is Chinese characters unicode
If (STR) match (regExp)) {
$(" p "). The HTML (' check successful Chinese characters');
} else {
$(" p "). The HTML (included in the 'input of Chinese characters');
}
//if not, try this [^] [\ u4e00 - \ u9fa5] * *

CodePudding user response:

https://blog.csdn.net/weixin_40687883/article/details/81187797
  • Related