Hi
I have simple below create form. It display validation message on load. I want user to click save to display validation message not on load.
@model CapCloud.Web.Models.Users.UserSettings
@{
ViewData["Title"] = "Create User";
}
@{
var hideClient = string.IsNullOrEmpty(Model.Client) ? "" : "hide";
}
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="panel panel-default bootcards-richtext">
<div class="panel-heading">
<h4>Add New Client</h4>
</div>
<div class="form-horizontal">
<div class="modal-body">
@Html.ValidationSummary(false, "", new { @class = "text-danger" })
<div class="form-group">
<div class="col-md-2">
<label asp-for="UserName" class="control-label"></label>
</div>
<div class="col-md-10">
<input asp-for="UserName" class="form-control" placeholder="username" />
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label asp-for="FirstName" class="control-label"></label>
</div>
<div class="col-md-10">
<input asp-for="FirstName" class="form-control" placeholder="First Name" />
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label asp-for="LastName" class="control-label"></label>
</div>
<div class="col-md-10">
<input asp-for="LastName" class="form-control" placeholder="Surname" />
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label asp-for="EmailAddress" class="control-label"></label>
</div>
<div class="col-md-10">
<input asp-for="EmailAddress" class="form-control" placeholder="Enter your email address" />
</div>
</div>
</div>
<div class="panel-footer clearfix">
<div class="btn-group pull-left">
<button class="cancel btn btn-danger" data-dismiss="modal" asp-action="Index" formnovalidate>
Cancel
</button>
</div>
<div class="btn-group pull-right">
<button type="submit" class="btn btn-success" data-dismiss="modal">
Save
</button>
</div>
</div>
</div>
</div>
</div>
</div>
}