Skip to content

Commit

Permalink
feat: reset form fields on submission
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaleshe authored and zeim839 committed Feb 7, 2024
1 parent 3f3f6cb commit 1551299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions public/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global XMLHttpRequest, alert, turnstile */
const horizontalScrollContainer = document.querySelector('.portfolio__cards__scroll')
const contactForm = document.getElementById('submit-email-form')
const btnLeft = document.querySelector('.portfolio__cards__scroll__btn-left')
const btnRight = document.querySelector('.portfolio__cards__scroll__btn-right')
const scrollableWidth = horizontalScrollContainer.scrollWidth
Expand Down Expand Up @@ -49,6 +50,8 @@ const sendEmail = (event) => {
return
}

contactForm.reset()

alert('Message sent succesfully. Check your email (& spam folder) for confirmation of receipt.')
}
}
Expand Down

0 comments on commit 1551299

Please sign in to comment.