Shaani
(Aziz Zee)
1
Is there a way to display single message for multiple attributes like this
In model I have
array('areaCode, countryCode, contactNumber', 'required', 'message'=>'{attribute} cannot be blank'),
In view, this doesn’t work
<?php echo $form->error($model,'contactNumber, areaCode, countryCode'); ?>
the CActive form error method only accepts single attribute parameter
softark
(Softark)
2
Shaani
(Aziz Zee)
3
No. This displays error for all attributes in the model
softark
(Softark)
4
I see.
Maybe you have to do it for yourself using CModel::getError() method.
Shaani
(Aziz Zee)
5
getError() is used for single attribute and getErrors() for single or all attributes