Skip to content

Commit 4656c19

Browse files
committed
Merge branch 'master' of github.com:victorjonsson/jQuery-Form-Validator
2 parents 4334577 + 1721ce8 commit 4656c19

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ particular form.
4040

4141
### Support for HTML5
4242

43-
As of version 2.2 (unreleased) you can use this plugin as a fallback solution for the validation attributes in the HTML5 spec. Add the module `html5` to the module string and you can use the following native features:
43+
As of version 2.2 (unreleased) you can use this plugin as a fallback solution for the validation attributes in the HTML5 spec. Add the module `html5` to the module declaration and you can use the following native features:
4444

4545
**Attributes**: require, pattern, maxlength, min, max, placeholder
4646

@@ -67,6 +67,7 @@ As of version 2.2 (unreleased) you can use this plugin as a fallback solution fo
6767
* Make validation dependent on another input of type checkbox being checked by adding attribute
6868
data-validation-if-checked="name of checkbox input"
6969
* Create input suggestions with ease, no jquery-ui needed
70+
* to apply multiple validators to an input element, separate the validator names using a space (ex: required email)
7071

7172
Read the documentation for the default features at [http://formvalidator.net/#default-validators](http://formvalidator.net/#default-validators)
7273

form-validator/jquery.form-validator.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -762,16 +762,11 @@
762762
} else {
763763
var findScriptPathAndLoadModules = function() {
764764
var foundPath = false;
765-
$('script').each(function() {
766-
if( this.src ) {
767-
var scriptName = this.src.substr(this.src.lastIndexOf('/')+1, this.src.length);
768-
if(scriptName.indexOf('jquery.form-validator.js') > -1 || scriptName.indexOf('jquery.form-validator.min.js') > -1) {
769-
foundPath = this.src.substr(0, this.src.lastIndexOf('/')) + '/';
770-
if( foundPath == '/' )
771-
foundPath = '';
772-
return false;
773-
}
774-
}
765+
$('script[src*="form-validator"]').each(function() {
766+
foundPath = this.src.substr(0, this.src.lastIndexOf('/')) + '/';
767+
if( foundPath == '/' )
768+
foundPath = '';
769+
return false;
775770
});
776771

777772
if( foundPath !== false) {

0 commit comments

Comments
 (0)