日期:2014-05-16 浏览次数:20428 次
new RequiredValidator().add("n1", "n2", "n3", "n4");
var requiredValidator = new RequiredValidator(); requiredValidator.add("n1", "n2").addId('id1', 'id2'); //在某个时候需要取消验证 requiredValidator.removeId('id1', 'id2'); //移除id为id1和id2的验证 requiredValidator.remove('n1', 'n2'); //移除name为n1和n2的验证
var IpValidator = Class.create(); IpValidator.prototype = Object.extend(new RegexValidator(), { initialize:function() { this.ipInitialize(); }, ipInitialize:function() { this.baseInitialize(); this.message = validateI18nMsgIp; this.regex = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; } });