/*! * Validator v0.11.5 for Bootstrap 3, by @1000hz * Copyright 2016 Cina Saffary * Licensed under http://opensource.org/licenses/MIT * * https://github.com/1000hz/bootstrap-validator */+function($){'use strict';function getValue($el){return $el.is('[type="checkbox"]')?$el.prop('checked'):$el.is('[type="radio"]')?!!$('[name="'+$el.attr('name')+'"]:checked').length:$el.val()} var Validator=function(element,options){this.options=options this.validators=$.extend({},Validator.VALIDATORS,options.custom) this.$element=$(element) this.$btn=$('button[type="submit"], input[type="submit"]').filter('[form="'+this.$element.attr('id')+'"]').add(this.$element.find('input[type="submit"], button[type="submit"]')) this.update() this.$element.on('input.bs.validator change.bs.validator focusout.bs.validator',$.proxy(this.onInput,this)) this.$element.on('submit.bs.validator',$.proxy(this.onSubmit,this)) this.$element.on('reset.bs.validator',$.proxy(this.reset,this)) this.$element.find('[data-match]').each(function(){var $this=$(this) var target=$this.data('match') $(target).on('input.bs.validator',function(e){getValue($this)&&$this.trigger('input.bs.validator')})}) this.$inputs.filter(function(){return getValue($(this))}).trigger('focusout') this.$element.attr('novalidate',true) this.toggleSubmit()} Validator.VERSION='0.11.5' Validator.INPUT_SELECTOR=':input:not([type="hidden"], [type="submit"], [type="reset"], button)' Validator.FOCUS_OFFSET=20 Validator.DEFAULTS={delay:500,html:false,disable:true,focus:true,custom:{},errors:{match:'Does not match',minlength:'Not long enough'},feedback:{success:'glyphicon-ok',error:'glyphicon-remove'}} Validator.VALIDATORS={'native':function($el){var el=$el[0] if(el.checkValidity){return!el.checkValidity()&&!el.validity.valid&&(el.validationMessage||"error!")}},'match':function($el){var target=$el.data('match') return $el.val()!==$(target).val()&&Validator.DEFAULTS.errors.match},'minlength':function($el){var minlength=$el.data('minlength') return $el.val().length