Validateonchange / Field Validation

Is it possible for CActiveForm validation to work on input fields when their values have not changed?

For example if I open a form who’s fields have already been populated with values, I then tab through each field, any fields that have valid data should get success class applied to them - even if I don’t change the values.

Currently the success class only gets applied to fields if I change their values and then press tab.

Hi,

Please can you mention your requirement and current problem and expected output?

I would just trigger the blur event after the page has loaded.

Give this a try.




$(function() {

  $('input').blur();

});



No, that’s not what I want.

Currently, when I tab from field to field I only get ‘success’ css class applied IF I change the value in the field prior to pressing tab. This indicates that the new data entered is valid.

However in the same form if I tab from fields where I do not change the values, I don’t get the success CSS class, even though the data is still valid. This may confuse the user, as they may expect the same feedback when tabbing through all valid fields.