Home >Web Front-end >JS Tutorial >JS restricts the input box (all commonly used ones)_javascript skills

JS restricts the input box (all commonly used ones)_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:27:491588browse

1. The text box can only enter numeric codes (decimal points cannot be entered)

Copy code The code is as follows:



2. Only numbers can be entered, decimal points can be entered.
Copy code The code is as follows :




3. Number and decimal point method two
Copy code The code is as follows:



4. Only letters and Chinese characters can be entered
Copy code The code is as follows:



5. Only English letters and numbers can be entered, Chinese cannot be entered
Copy code The code is as follows:



6. Only numbers and English can be enteredchun
Copy the code The code is as follows:


7. There can only be up to two digits after the decimal point (numbers and Chinese can be entered). Letters and arithmetic symbols cannot be entered:
Copy code The code is as follows:



8. There can only be up to two digits after the decimal point (numbers, letters, Chinese) (can be input), you can input operation symbols:
Copy code The code is as follows:


//Only Chinese characters can be input:

//Only numbers can be entered:

//Only English and numbers can be entered:

//The control input box can only input text or numbers, or it does not allow the input of special characters
//The following characters are not allowed to be entered here: (like!@#$%^&*, etc.)

Statement:
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