Skip to content

Commit

Permalink
Merge pull request #311 from dwyl/reset-form
Browse files Browse the repository at this point in the history
Reset the web form on successful submission, fixes #283
  • Loading branch information
nelsonic authored Feb 19, 2019
2 parents c5c75f2 + a39aedf commit 7009d70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions form-submission-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
xhr.onreadystatechange = function() {
console.log(xhr.status, xhr.statusText);
console.log(xhr.responseText);
form.reset();
var formElements = form.querySelector(".form-elements")
if (formElements) {
formElements.style.display = "none"; // hide form
Expand Down

0 comments on commit 7009d70

Please sign in to comment.