1. Prevent the input of non-numbers, except for backspace
2. Limit the maximum input string length
//Limit the maximum input length
var checkMaxL = function(length) {
var regC = /[^ - ~] /g;
var regE = /D /g;
var str = jQuery("#remark").val();
if (regC.test(str)){
jQuery("#remark").val(str.substring(0, length));
}
if(regE.test(str)){
jQuery("# remark").val(str.substring(0, length));
}
}
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