HTML and CSS Reference
In-Depth Information
or is available from the following CDN:
http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js
I have downloaded version 1.11.1 and added it to my scripts folder under the name
jquery.validate.js. I have also added it to the head section of the web page:
<head>
<meta charset="utf-8">
<title>Task list</title>
<link rel="stylesheet" type="text/css" href="styles/tasks.css"
media="screen" />
<script src="scripts/jquery-2.0.3.js"></script>
<script src="scripts/jquery-tmpl.js"></script>
<script src="scripts/jquery.validate.js"></script>
<script src="scripts/jquery-serialization.js"></script>
<script src="scripts/tasks-controller.js"></script>
</head>
Fortunately, jQuery validation relies on the same attributes as HTML5 where possible, so
the required attributes are valid for both HTML5 and jQuery validation.
jQuery validation contains a large number of built in validators, these allow you to express
rules for:
• Validating a required field has a value.
• Validating a field contains a number.
• Validating the length of input data.
• Validating a number is in a range.
• Validating a field contains an email address.
• Validating a field contains a possibly valid credit card number.
In addition to these default validators; you can add your own validators.
In order to implement jQuery validation, we are first going to change the input field with
the name “task” to include a maximum length:
<input
type="text"
required="required"
maxlength="200"
name="task"
class="large"
placeholder="Breakfast
at
Tiffanys"/>
Search WWH ::




Custom Search