Created
March 11, 2016 09:19
-
-
Save roboriaan/6094ba6352bd4116e565 to your computer and use it in GitHub Desktop.
Form validation example
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
<form asp-action="AddNewRole" asp-controller="Admin"> | |
<div asp-validation-summary="ValidationSummary.ModelOnly"></div> | |
<div class="color-line"></div> | |
<div class="modal-header"> | |
<h4 class="modal-title">Add new role</h4> | |
<small class="font-bold"></small> | |
</div> | |
<div class="modal-body"> | |
<div class="panel-body"> | |
<div class="form-group"> | |
<label class="col-sm-2 control-label">Code</label> | |
<div class="col-sm-5"> | |
<input asp-for="Role.Code" type="text" id="inputCode" name="Role.Code" class="form-control"> | |
<span asp-validation-for="Role.Code" class="text-danger"></span> | |
</div> | |
</div> | |
<br /> | |
<div class="hr-line-dashed"></div> | |
<div class="form-group"> | |
<label class="col-sm-2 control-label">Description</label> | |
<div class="col-sm-10"> | |
<textarea asp-for="Role.Description" id="textAreaDescription" name="Role.Description" class="form-control" style="resize:none"></textarea> | |
<span asp-validation-for="Role.Description" class="text-danger"></span> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | |
<button type="submit" class="btn btn-primary">Save</button> | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment