1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    33
    Answers
    4
    Vote Rating
    0
    jag2000 is on a distinguished road

      0  

    Default Unanswered: Form validation with password confirmation

    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
    Biller is on a distinguished road

      0  

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    7
    Vote Rating
    1
    madflanderz is on a distinguished road

      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;
    	}

Thread Participants: 2

Tags for this Thread