Skip to content

Commit 719b39f

Browse files
committed
Remove previous errors if they don't persist during a new submission attempt
1 parent ce943eb commit 719b39f

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

docs/dist/js/validate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.4.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.4.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
@@ -540,6 +540,8 @@
540540
if (!hasErrors) {
541541
hasErrors = fields[i];
542542
}
543+
} else {
544+
validate.removeError(fields[i]);
543545
}
544546
}
545547

docs/dist/js/validityState-polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.4.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.4.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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "validate",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "A lightweight form validation script that augments native HTML5 form validation elements and attributes.",
55
"main": "./dist/js/validate.js",
66
"author": {

src/js/validate.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@
533533
if (!hasErrors) {
534534
hasErrors = fields[i];
535535
}
536+
} else {
537+
validate.removeError(fields[i]);
536538
}
537539
}
538540

static/js/validate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.4.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.4.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
@@ -540,6 +540,8 @@
540540
if (!hasErrors) {
541541
hasErrors = fields[i];
542542
}
543+
} else {
544+
validate.removeError(fields[i]);
543545
}
544546
}
545547

static/js/validityState-polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* validate v1.4.0: A lightweight form validation script that augments native HTML5 form validation elements and attributes.
2+
* validate v1.4.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)