Open speshulk926 opened 8 years ago
these are good suggestions. I'm a bit swamped right now, but I'll get to them.
Thanks! For now, I just separated my labels, textboxes and required fields and put ShowRequiredStar(false) on all of them. It works fine like that. I really love this product still and thanks for taking suggestions :)
So right now I have:
<img src="~/Content/img/bullet-red-icon.png" alt="Required" />
@Html.Bootstrap().LabelFor(m => m.FirstName).ShowRequiredStar(false)
@Html.Bootstrap().TextBoxFor(m => m.FirstName)
This is an enhancement request for the Required Asterisk. I'm looking for 2 things. Remember, these are just examples of what would be nice to have! I tried to use css to alter what was there and was unable to and didn't really want to go the javascript route if I didn't have to.
Example 1 - Image URL:
@Html.Bootstrap().TextBoxFor(m => m.FirstName).Label().ImageUrl('img/bullet.png')
would produce:
<label for="FirstName">First Name <img src="img/bullet.png" class="required" /></label>
<input name="FirstName" class="form-control" id="FirstName" type="text" value="" data-val-required="The FirstName field is required." data-val="true">
Example 2 - Required Star Location Left
@Html.Bootstrap().TextBoxFor(m => m.FirstName).Label().RequiredStarLeft()
would produce:
<label for="FirstName"><span class="required">*</span> First Name</label>
<input name="FirstName" class="form-control" id="FirstName" type="text" value="" data-val-required="The FirstName field is required." data-val="true">
Example 3 - Required Star Location Right
@Html.Bootstrap().TextBoxFor(m => m.FirstName).Label()
would produce:
<label for="FirstName">First Name <span class="required">*</span></label>
<input name="FirstName" class="form-control" id="FirstName" type="text" value="" data-val-required="The FirstName field is required." data-val="true">
Example 4 - Required Star Location Left with Image
@Html.Bootstrap().TextBoxFor(m => m.FirstName).Label().ImageUrl('img/bullet.png').RequiredStarLeft()
would produce:
<label for="FirstName"><img src="img/bullet.png" class="required" /> First Name</label>
<input name="FirstName" class="form-control" id="FirstName" type="text" value="" data-val-required="The FirstName field is required." data-val="true">