Skip to content

Commit

Permalink
Merge pull request #44 from MeetYourAI/yosh
Browse files Browse the repository at this point in the history
Yosh
  • Loading branch information
yoshinodev authored Sep 16, 2023
2 parents 16bf857 + b3a317e commit 278139b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1168,14 +1168,13 @@ <h2 class=" footer-col-title">contact information</h2>
body: data,
headers: {
'Accept': 'application/json',
'Access-Control-Allow-Origin': '*'
'Access-Control-Allow-Origin': '*',
}
}).then(response => {
if (response.ok) {
document.getElementById("successMessage").style.display = "block";
document.getElementById("errorMessage").style.display = "none";
document.getElementsByTagNameNS("input").value = " ";
document.getElementsByTagNameNS("textarea").value = " ";
form.reset();
} else {
response.json().then(data => {
if (Object.hasOwn(data, 'errors')) {
Expand All @@ -1194,6 +1193,13 @@ <h2 class=" footer-col-title">contact information</h2>
}

form.addEventListener(submitButton, handleSubmit)
submitButton.addEventListener("click", function () {
//only if the form is valid
if (form.checkValidity()) {
document.getElementById("contact-us-form").reset();
}

});

</script>

Expand Down

0 comments on commit 278139b

Please sign in to comment.