why error message can't show just below text box ?

why error message can’t showing just below text box ?

Its showing like this way.

Array ( [fname] => Array ( [0] => Fname cannot be blank. ) [lname] => Array ( [0] => Lname cannot be blank. ) [email] => Array ( [0] => Email cannot be blank. ) [pass] => Array ( [0] => Pass cannot be blank. ) [cpass] => Array ( [0] => CPass cannot be blank. ) [twitter] => Array ( [0] => Twitter cannot be blank. ) [facebook] => Array ( [0] => Facebook cannot be blank. ) [gplus] => Array ( [0] => Gplus cannot be blank. ) )

Are you using activeForm?

Two ways to display form element

<?= $form->field($model, ‘fname’) ?>

OR

[b]<div class=“form-group <?php echo isset($errors[‘fname’][0])?‘has-error’:’’; ?>”>

<?= Html::activeLabel($model, ‘fname’,[‘class’=>‘control-label’]); ?>

<?= Html::activeTextInput($model, ‘fname’,[‘class’=>‘form-control’]) ?>

<div class=“help-block”><?php echo isset($errors[‘fname’][0])?$errors[‘fname’][0]:’’; ?></div>

</div>[/b]