Skip to content

Commit 3e41343

Browse files
committed
v1.3.1
- Add integration for custom errors by providing a wrapper around the HTML5 Constraint API setCustomValidity() function - Fix: Restore customError property in the ValidityState() polyfill
1 parent 4761d67 commit 3e41343

File tree

9 files changed

+21
-11
lines changed

9 files changed

+21
-11
lines changed

dist/js/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.2.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.3.1: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
33
* (c) 2018 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/validate

dist/js/validate.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/validityState-polyfill.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.2.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.3.1: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
33
* (c) 2018 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/validate
@@ -100,6 +100,11 @@
100100
// Add valid property to validity object
101101
checkValidity.valid = valid;
102102

103+
// Assume a custom error if there is a validation message present but all the other checks returned valid
104+
if (checkValidity.valid && field.validationMessage !== '') {
105+
checkValidity.customError = true
106+
}
107+
103108
// Return object
104109
return checkValidity;
105110

dist/js/validityState-polyfill.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/js/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.2.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.3.1: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
33
* (c) 2018 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/validate

0 commit comments

Comments
 (0)