ExtJs 确认密码验证的实现
2013-05-22 14:07
357 查看
实现1:
*************************************************
Ext.apply(Ext.form.VTypes, {
confirmPwd : function(val, field) {
if (field.confirmPwd) {
var firstPwdId = field.confirmPwd.first;
var secondPwdId = field.confirmPwd.second;
this.firstField = Ext.getCmp(firstPwdId);
this.secondField = Ext.getCmp(secondPwdId);
var firstPwd = this.firstField.getValue();
var secondPwd = this.secondField.getValue();
if (firstPwd == secondPwd) {
return true;
} else {
return false;
}
}
},
confirmPwdText : '两次输入的密码不一致!'
});
================================================
{
id : 'password',
name : 'password',
width : 140,
fieldLabel : '<font color="red">密 码</font>',
// confirmPwd : {
// first : 'password',
// second : 'confirmPassword'
// },
// inputType : 'password',
// vtype : 'confirmPwd',
allowBlank : false,
blankText : '密码不能为空',
regex : /^[\s\S]{0,20}$/,
regexText : '密码长度不能超过20个字符'
}, {
id : 'confirmPassword',
name : 'confirmPassword',
width : 140,
fieldLabel : '<font color="red">确认密码</font>',
confirmPwd : {
first : 'password',
second : 'confirmPassword'
},
// inputType : 'password',
vtype : 'confirmPwd',
allowBlank : false,
blankText : '确认密码不能为空',
regex : /^[\s\S]{0,20}$/,
regexText : '确认密码长度不能超过20个字符'
}
-----------------------------------------------------------------------------------------------------
实现2:
*************************************************
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 : '两次输入的密码不一致!'
});
=================================================
{
id : 'newPwd',
name : 'newPwd',
width : 140,
inputType : 'password',
fieldLabel : '<font color="red">新 密 码</font>',
allowBlank : false,
blankText : '新密码不能为空',
regex : /^[\s\S]{0,12}$/,
regexText : '新密码长度不能超过12个字符'
}, {
name : 'confirmPwd',
width : 140,
inputType : 'password',
fieldLabel : '<font color="red">确认密码</font>',
vtype : 'password',
initialPassField : 'newPwd',
allowBlank : false,
blankText : '确认密码不能为空',
regex : /^[\s\S]{0,12}$/,
regexText : '旧密码长度不能超过12个字符'
}
=================================================
相关阅读:
ExtJs 确认密码验证的两种实现 http://taink.iteye.com/blog/618214
ExtJS中表单验证使用自定义vtype示例 http://www.cnblogs.com/buzz/archive/2009/03/31/1425794.html
Ext JS 中实现自定义验证 密码修改 确认密码 http://floger.iteye.com/blog/599614
Ext JS 中实现自定义验证 密码修改 确认密码 http://blog.csdn.net/ttgzs/article/details/4239025
Extjs用户注册界面设计,包括密码,邮箱等匹配和验证 http://hi.baidu.com/pekdou/item/108039cc978b4fccef183b78
*************************************************
Ext.apply(Ext.form.VTypes, {
confirmPwd : function(val, field) {
if (field.confirmPwd) {
var firstPwdId = field.confirmPwd.first;
var secondPwdId = field.confirmPwd.second;
this.firstField = Ext.getCmp(firstPwdId);
this.secondField = Ext.getCmp(secondPwdId);
var firstPwd = this.firstField.getValue();
var secondPwd = this.secondField.getValue();
if (firstPwd == secondPwd) {
return true;
} else {
return false;
}
}
},
confirmPwdText : '两次输入的密码不一致!'
});
================================================
{
id : 'password',
name : 'password',
width : 140,
fieldLabel : '<font color="red">密 码</font>',
// confirmPwd : {
// first : 'password',
// second : 'confirmPassword'
// },
// inputType : 'password',
// vtype : 'confirmPwd',
allowBlank : false,
blankText : '密码不能为空',
regex : /^[\s\S]{0,20}$/,
regexText : '密码长度不能超过20个字符'
}, {
id : 'confirmPassword',
name : 'confirmPassword',
width : 140,
fieldLabel : '<font color="red">确认密码</font>',
confirmPwd : {
first : 'password',
second : 'confirmPassword'
},
// inputType : 'password',
vtype : 'confirmPwd',
allowBlank : false,
blankText : '确认密码不能为空',
regex : /^[\s\S]{0,20}$/,
regexText : '确认密码长度不能超过20个字符'
}
-----------------------------------------------------------------------------------------------------
实现2:
*************************************************
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 : '两次输入的密码不一致!'
});
=================================================
{
id : 'newPwd',
name : 'newPwd',
width : 140,
inputType : 'password',
fieldLabel : '<font color="red">新 密 码</font>',
allowBlank : false,
blankText : '新密码不能为空',
regex : /^[\s\S]{0,12}$/,
regexText : '新密码长度不能超过12个字符'
}, {
name : 'confirmPwd',
width : 140,
inputType : 'password',
fieldLabel : '<font color="red">确认密码</font>',
vtype : 'password',
initialPassField : 'newPwd',
allowBlank : false,
blankText : '确认密码不能为空',
regex : /^[\s\S]{0,12}$/,
regexText : '旧密码长度不能超过12个字符'
}
=================================================
相关阅读:
ExtJs 确认密码验证的两种实现 http://taink.iteye.com/blog/618214
ExtJS中表单验证使用自定义vtype示例 http://www.cnblogs.com/buzz/archive/2009/03/31/1425794.html
Ext JS 中实现自定义验证 密码修改 确认密码 http://floger.iteye.com/blog/599614
Ext JS 中实现自定义验证 密码修改 确认密码 http://blog.csdn.net/ttgzs/article/details/4239025
Extjs用户注册界面设计,包括密码,邮箱等匹配和验证 http://hi.baidu.com/pekdou/item/108039cc978b4fccef183b78
相关文章推荐
- Extjs4.x Vtype扩展实现验证密码和确认密码相等
- ExtJs 确认密码验证的两种实现
- ExtJs 确认密码验证的两种实现
- EXTJS 密码确认与验证
- Ext JS 中实现自定义验证 密码修改 确认密码
- Ext JS 中实现自定义验证 密码修改 确认密码
- ExtJS4 如何实现密码验证
- ASP.net验证控件详解和按钮点击事件后验证控件的执行顺序问题以及在确认密码框为空,CompareValidator认为是合法的问题的解决方案
- DoNet用Ajax实现对修改密码时输入数据合法性的验证
- jQuery+ajax实现修改密码验证功能实例详解
- Asp.net2005不用Ajax实现无刷新验证用户名、密码和中文验证码
- 使用profile的PASSWORD_VERIFY_FUNCTION参数实现自定义的密码验证规则
- [置顶] Java+Eclipse+Maven+struts2从MySQL数据库中查询用户密码实现简单的登录验证
- 如何实现从控制台输入c语言字符串密码,然后用oc的中的NSString方法来验证
- 第一百五十一节,封装库--JavaScript,表单验证--密码确认验证--回答验证--电子邮件验证加自动补全
- JQuery实现密码强度验证
- Asp.net2005不用Ajax实现无刷新验证用户名、密码和中文验证码
- ExtJS中表单验证使用自定义vtype(两次输入密码重复)示例
- jquery实现密码和确认密码的输入框中不能复制,粘贴,剪切,和右键
- 利用Dll实现通用密码验证框