Skip to content

Commit

Permalink
Fix problem for hidden fileds
Browse files Browse the repository at this point in the history
  • Loading branch information
abdollahpour committed Mar 25, 2015
1 parent 93fc077 commit 98efc8b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bootstrap.validator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Bootstrap.validator plugin for JQuery and Bootstrap 3.
* https://github.com/wpic/bootstrap.validator.js
* By Hamed Abdollahpour 2014 - WPIC Co
*/
(function ( $ ) {

$.fn.validate = function( options ) {
Expand Down Expand Up @@ -27,8 +32,11 @@
settings.init.call(form);

var data = {};
$('input,textarea,select', this).each(function() {
$('input,textarea,select', this).filter(":visible,[type='hidden']").each(function() {
var i = $(this);
if(!i.parent().is(':visible')) {
return;
}
var name = i.attr('name');
if(typeof(name) != 'undefined' && (i.is(":not([type='checkbox'],[type='radio'])") || i.is(":checked"))) {
var value = i.val();
Expand All @@ -51,7 +59,7 @@
}

/** [data-require] is deprecated use requried instead **/
$("[data-regex],[data-require],[data-required],[required],[data-equals]", form).each(function() {
$("[data-regex],[data-require],[data-required],[required],[data-equals]", form).filter(':visible').each(function() {
var self = $(this);

var regex = self.attr('data-regex');
Expand Down

0 comments on commit 98efc8b

Please sign in to comment.