
template.bootstrap.js.validation.min.js Maven / Gradle / Ivy
/*!
* validation.js
*
* Client Validation for Bootstrap Forms
*
* Requires use of jQuery.
* Tested with jQuery 1.7
*
* Copyright (c) 2012 Johannes Geppert http://www.jgeppert.com
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
;function bootstrapValidation(a,c){a.find("div.has-error").removeClass("has-error");a.find("div.has-feedback").removeClass("has-feedback");a.find("span.s2_help_inline").remove();a.find("span.s2_feedback").remove();a.find("div.s2_validation_errors").remove();if(c.errors&&c.errors.length>0){var b=$("");a.prepend(b);$.each(c.errors,function(d,e){b.append(""+e+"
\n")})}if(c.fieldErrors){$.each(c.fieldErrors,function(e,g){var f=a.find(':input[name="'+e+'"]'),h,d;if(f&&f.length>0){f=$(f[0]);h=f.closest("div.form-group");h.addClass("has-error");h.addClass("has-feedback");d=h.find("div.controls");if(d){if(!(f.is(":radio")||f.is(":checkbox"))){d.append("")}d.append(""+g[0]+"")}}})}};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy