You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Can we use an image instead of (or in addition to) the textual " * "?
Can we assign the placement of the image and/or text to where the label is?
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">
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
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 :)
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">
The text was updated successfully, but these errors were encountered: