Ext.apply(Ext.form.VTypes,{
password:function(val,field){val指这里的文本框值,field指这个文本框组件
if(field.confirmTo){//confirmTo是我们自定义的配置参数,一般用来保存另外的组件的id值
var pwd=Ext.get(field.confirmTo);//取得confirmTo指向组件ID的值
return (val==pwd.getValue());
}
return true;
}
//passwordText : 'Passwords do not match'
});
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget='side';
var panel=new Ext.FormPanel({
title:'password verification',
frame:true,
width:300,
labelWidth:100,
defaults:{
width:150
//inputType:'password'
},
defaultType: 'textfield',
items:[{
xtype:'textfield',
fieldLabel : "姓名",
name : "author_nam",
regex : /[\u4e00-\u9fa5]/, //正则表达式在/.
EXTjs 密码验证
最新推荐文章于 2017-01-06 13:32:58 发布