Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Last active December 6, 2020 15:25
Show Gist options
  • Save Abhayparashar31/9a70f6c8d382f7ec35bf62718fe6a6d5 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/9a70f6c8d382f7ec35bf62718fe6a6d5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action='' method='POST' name='form'>
<label for="fname">Name:</label><br>
<input type="text" id="name" name="Name"><br>
<label for="lname">Email:</label><br>
<input type="text" id="email" name="Email"><br>
<label for="lname">Message:</label><br>
<input type="text" id="message" name="Message"><br>
<input type='submit'>
</form>
<script>
const scriptURL = 'PASTE_THE_GENERATED_URL_HERE'
const form = document.forms['form']
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => alert("Thanks for Contacting us..!"))
.catch(error => console.error('Error!', error.message))
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment