TwitterBootstrapMvc icon indicating copy to clipboard operation
TwitterBootstrapMvc copied to clipboard

Input groups in a formgroup.

Open johnwc opened this issue 8 years ago • 2 comments

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>

johnwc avatar Nov 18 '16 18:11 johnwc

Why can't you use @TextBoxFor:

@Html.Bootstrap().TextBoxFor(m => m.UserName).Prepend("$").Label().HelpIcon()

DmitryEfimenko avatar Nov 21 '16 22:11 DmitryEfimenko

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.

johnwc avatar Nov 21 '16 23:11 johnwc