PDA

View Full Version : Confirm Password



tayyabah
29 Oct 2010, 6:20 AM
I have a form with monitorValid:true so that if any validation error occurs the submit button will be disabled automatically. My form have password and confirm password fields. I have applied the vtype: 'password' as defined in adv-vtype example. Additionally I have added the allowBlank: true and given the minlength:6. The 'password' vtype is not marking the fields invalid. When this field reaches 6 length the submit button get enabled besides the 'password' validation is returning false. Can anybody help me what am I doing wrong? Here is the code snippet


initComponent: function() {
items: [
// other fields here
{
fieldLabel:bundle.getMsg('column.password'),
id: 'password',
name:'password',
inputType:'password',
allowBlank:true,
enableKeyEvents: true,
minLength: 6,
minLengthText: bundle.getMsg('user.password.minlength'),
maxLength: 15,
maxLengthText: bundle.getMsg('user.password.maxlength'),
blankText: 'Required',
anchor: '100%'
},{
fieldLabel:bundle.getMsg('column.confirmPassword'),
id:'cpassword',
name:'cpassword',
inputType:'password',
enableKeyEvents: true,
allowBlank:true,
minLength: 6,
minLengthText: bundle.getMsg('user.confirmPassword.minlength'),
maxLength: 15,
maxLengthText: bundle.getMsg('user.confirmPassword.maxlength'),
blankText: 'Requireeeed',
anchor: '100%',
vtype: 'password',
initialPassField: 'password'
}]
}]


Can anybody tell me what am I doing wrong? I even try to use markInvalid() in the 'password' vtype but nothing happening :-( I am stuck here