jQuery Validate:http://www.runoob.com/jquery/jquery-plugin-validate.html
sweetalert.js:http://www.htmleaf.com/jQuery/Lightbox-Dialog/20141218888.html$("#LinkCommentForm").validate({ rules: { fname: "required", sitename: { required: true, minlength: 10 }, siteurl: { required: true, minlength: 2, url: true }, SiteEmail: { required: true, email: true } }, messages: { rurl: "Please enter your rurl", sitename: { required: "Please provide a sitename", minlength: "Your password must be at least 5 characters long" }, siteurl: { required: "Please enter a siteurl", minlength: "Your username must consist of at least 2 characters", }, SiteEmail: "Please enter a valid email address" }, showErrors: function (errorMap, errorList) { swal({ title: "Here's a message!", text: errorList[0].message, timer: 2000, showConfirmButton: false }); $(errorList[0].element).focus();}, onfocusout:false,onkeyup:false, });http://www.cnblogs.com/qiufengke/p/4964893.html