0
有一个文本框,检查长度,并允许一些特殊字符必须检查的长度和我有只允许一些特殊的系统字符有一个文本框
function checkPasswordLength(thisValue) {
var regexp1 = new RegExp("(www|http|https|WWW|HTTP|HTTPS)");
var regexp2 = /^[a-zA-Z0-9 [email protected]#$%&*]$/i;
if ((thisValue.length<8)||(!regexp2.test(thisValue.value))||regexp1.test(thisValue.value)) {
modal({
type: 'warning',
title: 'Warning',
text: 'Password must contain at least eight characters!!<br/>Special Character such as (:<>,.~`(){};/") are not allowed',
center: false,
callback: function() { $(thisValue).focus(); }
});
exit;
return false;
}
return true;
}
这里是fiddle。
你想在文本框中允许什么特殊字符。网址? – 2015-04-04 05:23:03