How to display error div just after "form-group" class
Closed this issue · 1 comments
rupalgohel commented
How can shif error p tag just after form-group
<div class="col-sm-6">
<div class="form-group field-signupform-value1 required">
<label class="control-label" for="signupform-value1">value1 Name</label>
<input type="text" id="signupform-value1" class="form-control" name="SignupForm[value1]" placeholder="value1 Name" aria-required="true">
<p class="help-block help-block-error"></p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group field-signupform-value1 required">
<label class="control-label" for="signupform-value1">value1 Name</label>
<input type="text" id="signupform-value1" class="form-control" name="SignupForm[value1]" placeholder="value1 Name" aria-required="true">
</div>
<p class="help-block help-block-error"></p>
</div>
rupalgohel commented
I achieved by below code.
<?php
$form = ActiveForm::begin([
'fieldConfig'=>['template'=>' <div class="custom">
{label}{input}
</div>
{error}',
'inputOptions' => [
'placeholder' => 'Username ...',
'class'=>'form-control',
]]
]); ?>
and given css to "custom" class for border-box