1. User- user_id, name, age
2. Address- user_id, city, state
for creating 2 table only Usercontroller used. The form of "User" contain the fields of "Address". like this
<div class="row">
<?php echo $form->labelEx($model,'name'); ?>
<?php echo $form->textField($model,'name',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx(Address::model(), 'city'); ?>
<?php echo $form->textField(Address::model(), 'city', array('size' => 50, 'maxlength' =>50));>
<?php echo $form->error(Address::model(), 'city'); ?>
</div>
The validation of user table fields worked correctly. but the validation (field is empty, required) for "Address" table not worked. How can add validation to both model form fields?

Help














