Results 1 to 3 of 3

Thread: Form validation with password confirmation

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    33
    Answers
    4
    Vote Rating
    0
      0  

    Default Unanswered: Form validation with password confirmation

    Hi at all.

    I have a litte registration form and I whant to validate, if the value in the field "password Confirmation" equals the value of the field "password". How could I config my models validations? Is there a way to do this with a inclusion list?

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    11
    Vote Rating
    0
      0  

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    7
    Vote Rating
    1
      0  

    Default

    It seem there is no direct way to validate against other model properties. But you can easyly override the validate method and add extra errors like this:

    Code:
    
    	,validate: function() {
    
    
    		var errors = this.callParent(arguments);
    
    
    
    
    		if( this.get("password") != this.get("passwordRepeat"))
    		{
    			errors.add(Ext.create('Ext.data.Error', {
    				field  : passwordRepeat,
    				message: _("PasswordRepeatError")
    			}));
    		}
    
    
    
    
    		return errors;
    	}

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •