Cannot be empty
Only English and numbers can be entered
Judgment characters are composed of letters, numbers, underscores, and periods. And the beginning can only be underscores and letters
/^([a-zA-z_]{1})([ w]*)$/g.test(str)
Only numbers can be entered
Only Chinese can be entered
Only English can be entered
Only Chinese, English, numbers, @ symbols and . symbols can be entered
Only English input is allowed, and neither paste nor pop-up of the paste menu is possible
Only numbers and periods can be entered (Note:The d in [^d.] cannot be written as a capital D, otherwise it will become all characters except numbers)
In short: first enter onkeyup="value=value.replace(/[^X]/g,'')" in and then X in (/[X]/g,'') Just replace it with the code you want to enter
Chinese: u4E00-u9FA5
Number: d, 0-9
English: a-z, A-Z
Other symbols@ , dot or other symbols. You can also have multiple, just separate them with
For example:
Chinese, English and numbers plus @ symbol plus dot symbol: a-zA-Z0-9u4E00-u9FA5@.
If you want to prevent the right-click pop-up menu and paste copied information in the text box, enter onKeyDown="fncKeyStop(event)" in the onpaste="return false" oncontextmenu="return false; "