Last active
December 6, 2020 15:25
-
-
Save Abhayparashar31/9a70f6c8d382f7ec35bf62718fe6a6d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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