|
@@ -45,7 +45,7 @@ $(document).ready(function() {
|
|
|
case 'tel-mobile' : msg='格式必须为国内固定电话或手机号类型,如:0511-4405222 或 021-87888822 或 18612345678';tolength='0';reg=/\d{3}-\d{8}|\d{4}-\d{7}|1[3|4|5|8][0-9]\d{8}$/;break;
|
|
|
case 'website' : msg='格式必须为网址类型,如:http://www.baidu.com?name=1';tolength='0';reg = '^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$';break;
|
|
|
case 'china-english-num': msg='该输入项只能输入中文、英文、数字';tolength='1';reg=/^([\u4e00-\u9fa5]|[a-zA-Z0-9])+$/;break;
|
|
|
- case 'date-to': msg='格式必须为日期类型,如:2012-01-01 to 2013-01-01';tolength='0';reg = /^((?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)) to ((?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29))$/i;break;
|
|
|
+ case 'date-to': msg='格式必须为日期类型,如:2012-01-01 to 2013-01-01';tolength='0';reg = /^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29) to (?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/i;break;
|
|
|
case 'mac': msg='格式必须为mac地址类型,中间以横杠或冒号分隔,如:00-01-6C-06-A6-29 或 00:01:6C:06:A6:29';tolength='1';reg=/^(([0-9a-fA-F]{2})(([:][0-9a-fA-F]{2}){5}))|(([0-9a-fA-F]{2})(([-][0-9a-fA-F]{2}){5}))$/;break;
|
|
|
case 'longitude': msg='格式必须为经度类型,范围在-180°~180°,如:(-)180 或 (-)116.34528 或 (-)86.8';tolength='1';reg=/^(-?((180)|(((1[0-7]\d)|(\d{1,2}))(\.\d{1,5})?)))$/;break;
|
|
|
case 'latitude': msg='格式必须为经度类型,范围在-90°~90°,如:(-)90 或 (-)86.34528 或 (-)8.3';tolength='1';reg=/^(-?((90)|((([1-8]\d)|(\d{1}))(\.\d{1,5})?)))$/;break;
|
|
@@ -71,6 +71,8 @@ $(document).ready(function() {
|
|
|
}
|
|
|
if(e.type == "password"){
|
|
|
$e.parent("span").parent("div").find("span.spanVaildate").html("此项不能为空!");
|
|
|
+ }if(e.id == "dateRangePicker"){
|
|
|
+ $e.parent("span").parent("div").find("span.spanVaildate").html("此项不能为空!");
|
|
|
}else{
|
|
|
$e.parent("div").find("span.spanVaildate").html("此项不能为空!");
|
|
|
}
|
|
@@ -86,6 +88,8 @@ $(document).ready(function() {
|
|
|
var charLen = (len%2==0)?(len/2):((len-1)/2);
|
|
|
if(e.type == "password"){
|
|
|
$e.parent("span").parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符("+charLen+"个汉字)!");
|
|
|
+ }else if(e.id == "dateRangePicker"){
|
|
|
+ $e.parent("span").parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符("+charLen+"个汉字)!");
|
|
|
}else{
|
|
|
$e.parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符("+charLen+"个汉字)!");
|
|
|
}
|
|
@@ -98,6 +102,8 @@ $(document).ready(function() {
|
|
|
$e.attr('title','数据长度最大为'+len+'个字符');
|
|
|
if(e.type == "password"){
|
|
|
$e.parent("span").parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符!");
|
|
|
+ }else if(e.id == "dateRangePicker"){
|
|
|
+ $e.parent("span").parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符!");
|
|
|
}else{
|
|
|
$e.parent("div").find("span.spanVaildate").html("数据长度最大为"+len+"个字符!");
|
|
|
}
|
|
@@ -109,6 +115,8 @@ $(document).ready(function() {
|
|
|
$e.attr('title',msg);
|
|
|
if(e.type == "password"){
|
|
|
$e.parent("span").parent("div").find("span.spanVaildate").html(msg);
|
|
|
+ }else if(e.id == "dateRangePicker"){
|
|
|
+ $e.parent("span").parent("div").find("span.spanVaildate").html(msg);
|
|
|
}else{
|
|
|
$e.parent("div").find("span.spanVaildate").html(msg);
|
|
|
}
|
|
@@ -118,6 +126,8 @@ $(document).ready(function() {
|
|
|
$e.removeClass('invalid-text');
|
|
|
if(e.type == "password"){
|
|
|
$e.parent("span").parent("div").find("span.spanVaildate").html("");
|
|
|
+ }if(e.id == "dateRangePicker"){
|
|
|
+ $e.parent("span").parent("div").find("span.spanVaildate").html("");
|
|
|
}else{
|
|
|
$e.parent("div").find("span.spanVaildate").html("");
|
|
|
}
|