ExtJs 암호 수정 인스턴스

1927 단어 extF#
// VType
Ext.apply(Ext.form.VTypes,{
	password:function(val,field){
		if(field.initialPassField){
			var pwd = Ext.getCmp(field.initialPassField);
			return (val == pwd.getValue());
		}
		return true;
	},
	passwordText:' '
});
Ext.onReady(function(){
	Ext.QuickTips.init();
	var changePasswordFrom = new Ext.form.FormPanel({
		title:' ',
		renderTo:'changepasswordPanel',
		frame:true,
		width:400,
		buttonAlign:'center',
		labelAlign:'right',
		labeWidth:80,
		defaultType:'textfield',
		defaults:{width:150,allowBlank:false,msgTarget:'side',
			 minLength:6,
			 minLengthText:' 6 ',
			 maxLength:10,
			 maxLengthText:' 10 '},
		items:[ 
			{
			 fieldLabel:' ',
			 name:'password',
			 inputType:'password',
			 blankText:' ',
			 id:'password'
			},{
			 fieldLabel:' ',
			 name:'secondPassword',
			 inputType:'password',
			 blankText:' ',
			 vtype:'password',
			 initialPassField:'password'
			}	
		],
		buttons:[{
			text:' ',
			handler:function(){
				if(!changePasswordFrom.getForm().isValid()){
	  		 	  return;
	  		   	}
				changePasswordFrom.getForm().submit({
					url:'../../changeSelfPassword.do',
					success:function(f,action){
						if(action.result.success){
							Ext.Msg.alert(' ');
						}
					},
					failure:function(f,action){ 
						changePasswordFrom.getForm().reset();
 						Ext.Msg.alert(' ');
 					} 
				});
			}
		}]
	});

});

좋은 웹페이지 즐겨찾기