CActiveFrom: use different validateOnXX for different fields

Hi there,

I’m trying to get just one of my form fields to validateOnChange, but have the rest of the fields validate on submit. I don’t think this is currently possible, so I’d like to request it as a feature.

In my case, I’d like to have the username field validate for its uniqueness, but all other fields can wait to validate on submit.


This is supported. You just need to configure

‘validateOnChange’=>false in ‘clientOptions’


‘validateOnChange’=>true in $htmlOptions when calling error() for the specific attribute.

Thanks! Seems like you’ve thought of everything with the validation system!