I want to use bootstrap formgroup. It works if I have one label and control, but if there are more than two controls (label, control and validation field), then the validation field will be on the next line.
I tried using form-inline but no luck. Can someone tell me how to save all the elements of a form group in one line?
<div class="form-group">
@Html.Label("Emp ID", new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.TextBoxFor(model => model.EmpID, new { disabled = "disabled", @class = "form-control" })
</div>
</div>
@* Tried with form-group *@
<div class="form-group">
@Html.LabelFor(model => model.EmployementTypeID, Constants.EmploymentType, new { @class = "col-sm-2 control-label" })
<div>
@Html.DropDownListFor(model => model.EmployementTypeID, new SelectList(Model.EmploymentType, "EmployementTypeID", "EmployementTypeName", Model.EmployementTypeID), new { @class = "form-control" })
@* This validation goes in next line, how can we keep it in the same line *@
@Html.ValidationMessageFor(model => model.EmployementTypeID)
</div>
</div>
@* Tried with form-inline *@
<div class="form-inline">
@Html.LabelFor(model => model.Address, Constants.Address, new { @class = "col-sm-2 control-label" })
<div>
@Html.TextAreaFor(model => model.Address, new { @class = "form-control col-sm-10" })
@* This validation goes in next line, how can we keep it in the same line *@
@Html.ValidationMessageFor(model => model.Address)
</div>
</div>
source
share