The second parameter to CActiveForm::labelEx() is the name of the model attribute. You should update the model’s attributeLabels() method to provide the correct label.
If you want to do it in the form instead, you can do so like this:
So is there any real need for a separate model attribute for the label? It’s only purpose is to provide a description for the corresponding text field.
I’m not sure if I fully understand, but by specifying the model attribute, Yii can add an error class to the label when it’s generated, so it can be styled differently. In general, the label is coloured red when an error occurs.
Thanks for the replies. So if I want to have the label text as (US$) and the "required" validation error text to be something different i.e. "USD cannot be blank", the only way to achieve this would be to change the label or override the validation error message?