{
fieldLabel: "管理密码",
id:"pwA",
name: "adminPW",
value:"admin",
inputType : "password",
allowBlank:false,
blankText: "密码不能为空!",
regex : /[^\s]{4,12}/,
regexText:"请输入4-12个字符!"
},{
fieldLabel: "重复密码",
inputType : "password",
name: "adminPWB",
value:"admin",
vtype:"password",
vtypeText:"两次密码不一致!",
confirmTo:"pwA"
}
Ext.apply(Ext.form.VTypes,{
password:function(val,field){
if(field.confirmTo){
var pwd=Ext.fly(field.confirmTo);
return (val==pwd.getValue());
}
return true;
}});
========================================================
fieldLabel : '电话钱包账号',
id : 'customno',
name : 'customno',
maxLength: 20,
maxLengthText: '超过最大可输入限制',
allowBlank : false,
listeners : {
'blur' : function() {
if(this.el.dom.value.length < 21 && this.el.dom.value.match(/^\d+$/) && this.el.dom.value.substring(0,2) == '99'){
this.setValue(this.el.dom.value);
}else{
alert("由于超过可输入限制,电话钱包账号必须是以99开头的小于21位数字!");
this.setValue('');
}
}
}