ReactiveRaven / jqBootstrapValidation

A JQuery validation framework for bootstrap forms.
http://reactiveraven.github.io/jqBootstrapValidation
MIT License
1.35k stars 334 forks source link

Not working properly with jQuery > 1.7.2 #202

Open pmirandaarias opened 7 years ago

pmirandaarias commented 7 years ago

In https://reactiveraven.github.io/jqBootstrapValidation/ the installation says:

Download jqBootstrapValidation and include the script tags on your page:

It works ok with that version, but when I try to use a newer version I always got error like:

Uncaught TypeError: Cannot read property 'length' of null jqBootstrapValidation.js:411

But if I use jQuery 1.7.2 I got:

Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4 bootstrap.min.js:6

I'm using Bootstrap v3.3.7.

Some of the functions of my webpage won't work with that old jQuery, like some simple slides among others.

How can avoid those issues? Is there a newer version of jQuery that is 100% compatible with this plugin?

pmirandaarias commented 7 years ago

Well, I resolve it.

  1. I followed this: https://github.com/ReactiveRaven/jqBootstrapValidation/issues/46
  2. I use the fork jqBootstrapValidation - v1.3.8 for Bootstrap 3
  3. I'm using now jQuery 1.9.1 (I have not tested in newer version, but Bootstrap was requiringat least that one).
  4. AND I did this:

var value = getValue($this); if(value === null) value =[];

In line 456, I had this error when my select wasn't selected yet, so it was a null value :)

vpxavier commented 5 years ago

Well, I resolve it.

1. I followed this: #46

2. I use the fork jqBootstrapValidation - v1.3.8 for Bootstrap 3

3. I'm using now jQuery 1.9.1 (I have not tested in newer version, but Bootstrap was requiringat least that one).

4. AND I did this:

var value = getValue($this); if(value === null) value =[];

In line 456, I had this error when my select wasn't selected yet, so it was a null value :)

I had a problem when validating "SELECT" HTML elements, adding var value = getValue($this); if(value === null) value =[]; at line 407 of jqBootstrapValidation.js (v1.3.6) solved the issue for me. Thanks a lot @pmirandaarias