我有两个字段的用户名和密码的登录表单。这些字段是有效的。但现在我想通过添加更多的字段,如密码和确认密码,现在发送电子邮件我如何确保输入的密码与确认密码字段匹配,以及如何验证电子邮件字段。如何使用jquery验证已经创建的表单,引导
Login form
<!-- Modal content-->
<div class="modal-content">
<section id="content1">
<form>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1 class="modal-title">Signin Form</h1>
</div>
<div class="modal-body">
<input type="text" placeholder="Username" required="" id="username" />
<input type="password" placeholder="Password" required="" id="password" />
</div>
<div class="modal-footer" style="padding-left:86px">
<input type="submit" value="Log in" style="background-color:whitesmoke" />
</div>
</form>
<!-- form -->
</section>
<!-- content -->
<!-- container -->
//</div>
我添加了这三个文件。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
MVC已经通过使用'ValidationAttributes'和使用相关脚本启用客户端验证来内置所有内容(客户端和基本服务器端验证)。 –