You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just stumbled upon this very same issue. And I figured out what's causing this. When You are using preValidate, equalTo still looks for the value from model, not from the attributes hash you passed in. Because you haven't set the value on model yet, validation fails. I think this is a bug and needs to be addressed.
validation: function() {
return {
username: {
required: true,
msg: ''
},
password: {
minLength: 8
},
rePassword: {
equalTo: 'password',
msg: 'The passwords does not match'
},
name: {
required: true,
msg: ''
},
address: {
required: false,
msg: ''
},
email: {
required: true,
msg: ''
}
};
}
the rePassword and password is always not match even if it is match
im using Backbone.Validation v0.9.1
with model.preValidate()
The text was updated successfully, but these errors were encountered: