Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working properly with jQuery > 1.7.2 #202

Open
pmirandaarias opened this issue Feb 22, 2017 · 2 comments
Open

Not working properly with jQuery > 1.7.2 #202

pmirandaarias opened this issue Feb 22, 2017 · 2 comments

Comments

@pmirandaarias
Copy link

pmirandaarias commented Feb 22, 2017

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

Download jqBootstrapValidation and include the script tags on your page:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="/js/jqBootstrapValidation.js"></script>

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
Copy link
Author

Well, I resolve it.

  1. I followed this: 'Uncaught TypeError: Cannot read property 'length' of undefined' on file input #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
Copy link

vpxavier commented Sep 15, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants