ext密码弹出窗口

//弹出窗口
var checkWindow_passwd = new Ext.Window({
//closeAction : 'close',
closable:false,
resizable : true,
bodyStyle : 'padding: 7',
modal : true,
title : '密码过期提示',
html : '',
width : 300,
height : 240,
items : [{xtype:'label',html:'<br><font color="red">您的密码已经过期,或长度不符合规范,请立即修改!<br></font>'},vailPasswd_oenpWind]
});

// 验证两次密码是否一样
Ext.apply(Ext.form.VTypes, {
password : function(val, field) {
if (field.confirmTo) {
var pwd = Ext.get(field.confirmTo);
if (val.trim() == pwd.getValue().trim()) {
return true;
} else {
return false;
}
return false;
}
}
});
// 密码修改窗口
var vailPasswd_oenpWind = new Ext.FormPanel({
frame : true,
labelWidth : 75,
labelAlign : 'right',
border : '0',
defaults : {
width : 160,
xtype : "textfield",
inputType : 'password',
allowBlank : false
},
items : [{
fieldLabel : '输入旧密码',
name : 'vaiOldPwd',
maxLength : 20,
blankText : '密码为空!',
maxLengthText : '密码长度不能超过20位!'
}, {
fieldLabel : '输入新密码',
name : 'vaiNewPwdOne',
id : 'vaiNewPwdOne',
maxLength : 20,
minLength:6,
regex : /^[a-zA-Z0-9]/,
regexText : '密码只能是字母或数字组合!',
blankText : '密码为空',
maxLengthText : '密码长度不能超过20位!'
}, {
fieldLabel : '确认新密码',
name : 'vaiNewPwdTwo',
id : 'vaiNewPwdTwo',
maxLength : 20,
minLength:6,
regex : /^[a-zA-Z0-9]/,
regexText : '密码只能是字母或数字组合!',
blankText : '密码为空',
maxLengthText : '密码长度不能超过20位!',
vtype : 'password',
vtypeText : '两次密码不一致',
confirmTo : 'vaiNewPwdOne'
}],
buttons : [{
text : '确定',
handler : function(btn) {
if (vailPasswd_oenpWind.getForm().isValid()) {
btn.disable();
var oldPwd = vailPasswd_oenpWind.getForm().findField('vaiOldPwd');
var newPwdOne = vailPasswd_oenpWind.getForm().findField('vaiNewPwdOne');
var newPwdTwo = vailPasswd_oenpWind.getForm().findField('vaiNewPwdTwo');
var userName = USERNAME;
Ext.Ajax.request({
url : 'changePassword.action',
waitTitle : '请稍候',
waitMsg : '正在修改密码,请稍候...',
params : {
oldPwd : oldPwd.getValue(),
newPwdOne : newPwdOne.getValue(),
newPwdTwo : newPwdTwo.getValue(),
userName : userName
},
success : function(response) {
var datas = Ext.util.JSON.decode(response.responseText);
if (datas.exeInfo != null) {
Ext.Msg.show({
title:'错误提示',
msg : datas.exeInfo,
buttons : Ext.MessageBox.OK,
icon : Ext.Msg.INFO,
fn : function(btnId, text) {
if (btnId == 'ok')
window.top.location.href = '/QNS/index.jsp';
}
});

oldPwd.focus(true);
oldPwd.reset();
newPwdOne.reset();
newPwdTwo.reset();
btn.enable();
vailPasswd_oenpWind.ownerCt.hide();
} else if (datas.exeInfo == null){
Ext.Msg.show({
title : '提示',
msg : '密码修改成功!',
buttons : Ext.MessageBox.OK,
icon : Ext.Msg.INFO,
fn : function(btnId, text) {
if (btnId == 'ok')
window.top.location.href = '/QNS/index.jsp';
}
});

oldPwd.focus(true);
oldPwd.reset();
newPwdOne.reset();
newPwdTwo.reset();
btn.enable();
vailPasswd_oenpWind.ownerCt.hide();
}else {
Ext.MessageBox.buttonText.ok = '确定';
Ext.MessageBox.buttonText.cancel = '取消';
Ext.Msg.show({
title : '错误提示',
msg : '会话结束【30分钟未操作或已登出】,请重新登录!',
buttons : Ext.Msg.OKCANCEL,
fn : function(btnId, text) {
if (btnId == 'ok')
window.top.location.href = '/QNS/index.jsp';
},
icon : Ext.Msg.INFO
});
}
}
});
}
}
}]
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值