Authored by leo

Fixed: 增加店铺域名校验

@@ -258,6 +258,22 @@ e.on("validate",function(){ @@ -258,6 +258,22 @@ e.on("validate",function(){
258 258
259 }); 259 });
260 260
  261 +// 对域名格式和长度做校验
  262 +e.on("validate", function() {
  263 + var shopDomainVal = $("#shopDomain").val();
  264 + if(shopDomainVal) {
  265 + var shopDomainPattern = new RegExp("^[a-zA-Z]([a-zA-Z-])*[a-zA-Z]$");
  266 +
  267 + if(shopDomainVal.length < 1 || shopDomainVal.length > 32) {
  268 + return "店铺域名输入有误!";
  269 + }
  270 +
  271 + if(!shopDomainPattern.test(shopDomainVal)) {
  272 + return "店铺域名输入有误!";
  273 + }
  274 + }
  275 +});
  276 +
261 e.init(); 277 e.init();
262 278
263 var submit=function(callback){ 279 var submit=function(callback){