密码规则校验
1.必须包含数字、下划线、字母,而且可以指定密码长度范围
checkout.pwdCheck = function( str,minLen,maxLen ){ var i,str = str + '',minLen = minLen || 0,len = str.length,maxLen = maxLen || len + 1,// 防止 maxLen 不传报错 pwdReg = [ /\d+?/g,/\w+?/g,/\_+?/g ]; if( minLen > len && maxLen < len || /\s+?/g.test( str ) ) return false; for( i = 0; i < pwdReg.length; i++ ){ if ( !pwdReg[i].test( str ) ) return false; } return true; };