afterValidate and ajaxValidation


I’m using the method afterValidate() on my model to validate one field (registration_code). The ajaxValidation is enabled on the form.

Recently I noticed the afterValidate() is executed after filling every field on the form… causing a little overhead… but I only need this method after changing the registration_code field.

There is a way to validate a field only a specific field? For now, I’m using the beforeSave() method (on model). It runs only when the user touches the submit button, but the drawback is the user needs to return to the registration_code field and correct the value.

How could I fix this? Can I "guess" what field of the form the user changed?




use your function for validation special field :

see this link :

My link

That’s exactly I needed!

Thanks! ;)