mvc 5 - bootstrap form validation sample with "required" attribute - (mvc or any html)


ekran görüntüsü,







kodlar,




@{
    ViewBag.Title = "Test1";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Test1</h2>

<hr />

<form id="form1" method="post" action="#">

<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email" required="true">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd" required="true" maxlength="5"  >
</div>

<hr />

<button type="submit" class="btn btn-warning">Submit</button>

</form>

<hr />

**************************************************************

Yorumlar