i have multiple instances of same model in one form (mainly for languages entries).
In actionCreate:
$model1 = new ContentCategoryNames();
$model2 = new ContentCategoryNames();
$model = new ContentCategory;
$this->performAjaxValidation([$model1, $model2]);
In view:
echo $form->labelEx($model1, '[1]name');
echo $form->textField($model1, '[1]name');
echo $form->error($model1, '[1]name');
echo $form->labelEx($model2, '[2]name');
echo $form->textField($model2, '[2]name');
echo $form->error($model2, '[2]name');
And it generates all fields with ids like ContentCategoryNames_1_name
, ContentCategoryNames_1_name_em_
and so on. This is fine, but when i try to make ajax validation, i get response: {"ContentCategoryNames_name":["Name cannot be blank."]}
- without sequence number (it must be "ContentCategoryNames_1_name":/*...*/
). What am i missing?
Taking steps from here