TwitterBootstrapMvc
TwitterBootstrapMvc copied to clipboard
Input groups in a formgroup.
I need to be able to add a input group, so that I can show a currency symbol before the input field. I have no way of doing that.
This is the call today.
@f.FormGroup().EditorFor(m => m.StartPrice).Label().HelpIcon()
I need something like so...
@f.FormGroup().EditorFor(m => m.StartPrice).AppendInputGroup("$").Label().HelpIcon()
and produce...
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
</div>
Why can't you use @TextBoxFor
:
@Html.Bootstrap().TextBoxFor(m => m.UserName).Prepend("$").Label().HelpIcon()
I am using a FormGroup first. I need the EditorFor because it utilizes the metadata that is applied to the property, a TextBoxFor does not.