In the previous posts I had show how to...
MVC:
- Code First Migrations in MVC 5
- Jquery DataTable in MVC
- Jquery DataTable multisearch paging and Sorting in MVC server side
- Jquery DataTable paging, Sorting and Multi search with datepicker in MVC server side
- Cascading DropDowns in Asp.Net MVC
- AngularJS with Web Api in Asp.net MVC using Token based Authentication
- Ajax helper Based Search in MVC
- Customizing Authorize attribute or Role based Authentication or Authorization in MVC
- Display message when user is not authorized in mvc
- How to use AutoMapper
AngularJS:
- Two way Binding in AngularJS
- Simple Routing in AngularJS
- Datatables in AngularJS and asp.net mvc
- Datatables Column Filter with AngularJS and asp.net mvc
- Datatable Exporting with AngularJS and asp.net mvc
<html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.js"></script>
<script src="http://cdn.jsdelivr.net/jquery.validation/1.15.0/additional-methods.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<form id="myform">
<br/>
<div class="container">
<div class="row">
<div class="col-xs-3">
<input type="text" name="field1" placeholder="Email" class="form-control"/>
</div>
</div>
<br/>
<div class="row">
<div class="col-xs-3">
<input type="text" name="field2" placeholder="Name" class="form-control"/>
</div>
</div>
<br/>
<div class="row">
<div class="col-xs-3">
<input type="submit" value="Save" class="btn btn-primary"/>
</div>
</div>
</div>
</form>
<style>
.error{
color:red
}
.container {
padding-right: 15px; /*15px in bootstrap.css*/
padding-left: 25px; /*idem*/
margin-right: auto;
margin-left: auto;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('#myform').validate({ // initialize the plugin
rules: {
field1: {
required: true,
email: true
},
field2: {
required: true,
minlength: 5
}
},
submitHandler: function (form) { // for demo
alert('valid form submitted'); // for demo
return false; // for demo
}
});
});
</script>
</html>
No comments:
Post a Comment