Last active
December 17, 2015 06:09
-
-
Save Maarten88/5563693 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="control-group error"> | |
<label class="control-label" for="Title">Title</label> | |
<div class="controls"> | |
<input class="input-block-level" data-val="true" data-val-required="Dit is een verplicht veld." id="Title" name="Title" type="text" value="Test Veiling"> | |
<span class="help-inline field-validation-error" data-valmsg-for="Title" data-valmsg-replace="true"> | |
<span for="Title" generated="true" class="" style="">Dit is een verplicht veld.</span> | |
</span> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="control-group error"> | |
<label class="control-label" for="Title">Title</label> | |
<div class="controls"> | |
<input class="input-validation-error input-block-level" data-val="true" data-val-required="Dit is een verplicht veld." id="Title" name="Title" type="text" value=""> | |
<span class="field-validation-error help-inline" data-valmsg-for="Title" data-valmsg-replace="true">Dit is een verplicht veld.</span> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.EditorFor(model => model.Title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Auction.Web.Utility | |
@model object | |
@{ | |
var htmlAttributes = new RouteValueDictionary(); | |
if (ViewBag.@class != null) | |
{ | |
htmlAttributes.Add("class", ViewBag.@class); | |
} | |
if (ViewBag.@type != null) | |
{ | |
htmlAttributes.Add("type", ViewBag.@type); | |
} | |
if (ViewBag.placeholder != null) | |
{ | |
htmlAttributes.Add("placeholder", ViewBag.placeholder); | |
} | |
} | |
<div class="control-group@(Html.ValidationErrorFor(m => m, " error"))"> | |
@Html.LabelFor(m => m, new { @class = "control-label" }) | |
<div class="controls"> | |
@Html.TextBox( | |
"", | |
ViewData.TemplateInfo.FormattedModelValue, | |
htmlAttributes) | |
@Html.ValidationMessageFor(m => m, null, new { @class = "help-inline" }) | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.setDefaults({ | |
highlight: function (element) { | |
$(element).closest(".control-group").addClass("error"); | |
}, | |
unhighlight: function (element) { | |
$(element).closest(".control-group").removeClass("error"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment