All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.bootstrap.js.validation.min.js Maven / Gradle / Ivy

The newest version!
/*!
 * validation.js
 *
 * Client Validation for Bootstrap Forms
 *
 * Requires use of jQuery.
 * Tested with jQuery 1.7
 *
 * Copyright (c) 2021 Johannes Geppert https://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(i,e){"use strict";if(i.find(".is-invalid").removeClass("is-invalid"),i.find(".invalid-feedback").removeClass("invalid-feedback"),i.find("div.s2_help_inline").remove(),i.find("small.s2_feedback").remove(),i.find("div.s2_validation_errors").remove(),e.errors&&e.errors.length>0){var a=$("
");i.prepend(a),$.each(e.errors,function(i,e){a.append("
"+e+"
\n")})}e.fieldErrors&&$.each(e.fieldErrors,function(e,a){var r=i.find(':input[name="'+e+'"]');r&&r.length>0&&((r=$(r[0])).addClass("is-invalid"),r&&(r.is(":radio")||r.is(":checkbox")||r.append(""),r.after("
"+a[0]+"
")))})}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy