How To Apply Error And Success Class For Validated Cjuiautocomplete Field?
Problems with proper highlighting of CJuiAutoComplete fieldsRate Topic:

Yii uses CSS classes "error" and "success" for highlighting validated fields. Fields which passed validation successfully are highlighted with green color, whereas failed fields - with red. All works fine with standard fields, but I have a problem with CJuiAutoComplete widget.

Fields created by CJuiAutoComplete are not highlighted anyhow. I'm able to add either "error" or "success" CSS class into the CJuiAutoComplete's "htmlOptions" (and it takes the effect), but I need this to work in the same dynamic manner, as it works for other fields.

How to setup CJuiAutoComplete widget to show appropriate colors for validation status (including validation via AJAX, which certainly involves some javascript part)?

Here "settings.attributes" contains a listing of persistent fields which are stored in DB. But my lookup fields are virtual (defined as variables in models, and added into "rules" array of the model). So the question is how to add virtual fields into activeform's attributes? Also it seems important to somehow "tell" to CModel's validate method (at server-side) to validate ALL attributes mentioned in "rules" array, not only those stored in DB.

The answer is found. Validation is performed only for those attributes from "rules" which have a corresponding call to $form->error method. You can find that form's attributes are filled in on the last line of CActiveForm::error method.

Seems very unintuitive, concealed, and misleading. I couldn't find any mention about this in docs, not to say that such design is highly questionable imho.