This article collects a few JS input boxes can only input Chinese, English, numerals, @ symbols and. Yes, the first one is only English. The second is to enter only Chinese, English, numerals, @ symbols and. Symbols, the third is to enter only English letters and numbers, can not enter Chinese and so on.
can only enter English
<input type= "text" onkeyup= "Value=value.replace (/[^a-za-z]/g, ')" > <input type= "text" onkeyup= "Value=value.replace (/[^a-za-z]/g, ')" > can only enter Chinese, English, numerals, @ symbols and. Symbols
<input type= "text" onkeyup= "Value=value.replace (/[^a-za-z0-9u4e00-u9fa5@.] G, "> Only letters and Chinese characters can be entered
<input onkeyup= "Value=value.replace (/[d]/g,") "Onbeforepaste=" Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[d]/g, ') "maxlength=10 name=" Numbers ">5. You can only enter English letters and numbers, you cannot enter Chinese
<input onkeyup= "Value=value.replace (/[^w./]/ig, ')" >6. can only enter numbers and English <font color= "Red" >chun</font>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.