JQUERY VALIDATION FIRST FLIGHT JSP

MyForm

<script src="/jquery/jquery-1.9.1.js”>
<script src="/jquery/jquery.validate.min.js”>

/* example styles for validation form demo */
#registrationForm label.error {
color: red;
display: inline-block;
padding: 0;
text-align: left;
}

.fieldlabel{
width:150px;
text-align: right;
}

(function($,W,D)
{
var JQUERY4U = {};

JQUERY4U.UTIL =
{
setupFormValidation: function()
{
//form validation rules
$(“#registrationForm”).validate({
rules: {
firstname: “required”,
lastname: “required”,
email: {
required: true,
email: true
},
password: {
required: true,
minlength: 5,
maxlength:12
},
mobile:{
required: true,
number: true,
minlength:10,
maxlength:10
}

},
messages: {
firstname: “First Name is required”,
lastname: “Last Name is required”,
password: {
required: “Password is required”,
minlength: “password must be at least 5 characters long”,
maxlength: “Password can be max 12 characters long”
},
mobile:{
required:”Mobile is Required”,
number: “Mobile can have digits only”,
minLength:”Mobile should have 10 digits”,
maxLength:”Mobile should have 10 digits”
},
email:{
required: “Email is Required”,
email: “Enter valid Email address”
}
},
submitHandler: function(form) {
form.submit();
}
});
}
}

//when the dom has loaded setup form validation rules
$(D).ready(function($) {
JQUERY4U.UTIL.setupFormValidation();
});

})(jQuery, window, document);

User Registration

Password:
First Name
Last Name
Email
Mobile
Advertisements

About rajkirpal

i am a software engineer. and i have decent knowledge about java technologies like ANDROID, Servlet, Jsp, Struts, Hibernet, Spring, J2ME, Java Script, Ajax, JQuery, CSS. Further i am Preparing Easy understandable materials/documents upon the same java technologies and developing project in core java , advanced java and j2me , ANDROID as per the requirements Also designing the web sites and logos Thank You.
This entry was posted in JQuery. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s