Reputation: 1126
Is it possible to modify the behaviur that an ActiveField in Yii2 has?
Yii2 has a default template to create and display input tags along with their errors/hints etc.
string $template = "{label}\n{input}\n{hint}\n{error}"
If i create a field as follows:
<?= $form->field($model, 'email')->textInput() ?>
using the above template, the label will be displayed followed by the input tag and the error tag (hint is optional).
But using bootstrap i want to display the error in a popover and not in the error tag which is generated. and if there are no errors, then a default message appear in the popover like "what is your email address?"
Thanks :)
Upvotes: 0
Views: 453
Reputation: 666
well i'm change .has-error
position from the site.css "{label}\n{input}\n{hint}\n{error}"
.has-error input{
background-color: rgba(231, 76, 60, 0.11119);
}
.has-error > .help-block {
float: right;
margin-right: 1vh;
margin-top: -9.2vh;
}
with this you well change this
For this:
Upvotes: 1