Js restrictions: Only English letters and numbers can be entered. Chinese characters and other special characters cannot be entered.

Source: Internet
Author: User

Friends who are experienced in web development will strictly verify the forms entered by users. I would like to share with you some experience in Form Verification, how to use JavaScript to restrict the input box to only English letters and numbers, not Chinese and other special characters. For more information, see the following code!

<Html xmlns = "http://www.phpernote.com/javascript-function/742.html"> 

The following describes the common events of onkeypress, onkeyup, and onblur:

The onkeypress event occurs when the keyboard key is pressed and a key is released.

The onkeyup event occurs when the keyboard button is released.

The onblur event occurs when the object loses focus.

Articles you may be interested in
  • Javascript restricts that only numbers (including decimal places) can be entered in the text box)
  • Summary of the string truncation function implemented by javascript (including introduction to the use of Js to intercept Chinese characters)
  • Js can only enter numbers and numbers with decimal points, compatible with IE and firefox
  • Prohibit web page right-click, copy, save as, View Source file and other functions to implement web page source code protection
  • How does php convert the br line breaks in html to line breaks in text input?
  • Css controls code for force-breaking and non-wrapping in English and Chinese
  • Php clears (deletes) the files in the specified directory, and does not delete the directory folder.
  • PHP analyzes the file header information to determine the type of the uploaded file

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.