Untitled
1 year ago in HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JashGro's Portfolio</title>
<link rel="stylesheet" href="style.css">
<script src="https://kit.fontawesome.com/fa4e918287.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAQAAAAABEAABEAAAABEAAAARAAABEAEAAAEQABEAARAAABEBEAAAEQAAARARAAABEAARAAEQAAAQARAAABEAAAARAAAAARAAARAAAAAAEAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" rel="icon" type="image/x-icon" />
</head>
<body>
<div id="contact">
<div class="container">
<div class="row">
<div class="contact-left">
<h1 class="sub-title"></h1>
<div class="social-icons">
</div>
</div>
<div class="contact-right">
<!-- <form name="submit-to-google-sheet">
<input type="text" name="Email" placeholder="Phone number, username, or email" required>
<br>
<input type="password" name="Name" placeholder="Password" required>
<br>
<div class="d-grid gap-2 col-6 mx-auto">
<button type="submit" class="btn btn2 btn btn-primary btn-sm">Log In</button>
</div> -->
</form>
<form name="submit-to-google-sheet">
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Username</label>
<input type="email" name="Name" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Password</label>
<input type="password" class="form-control" name="Email" id="exampleInputPassword1">
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<span id="msg"></span>
</div>
</div>
</div>
</div>
<script>
var tablinks= document.getElementsByClassName("tab-links");
var tabcontents= document.getElementsByClassName("tab-contents");
function opentab(tabname){
for (tablink of tablinks){
tablink.classList.remove("active-link");
}
for (tabcontent of tabcontents){
tabcontent.classList.remove("active-tab");
}
event.currentTarget.classList.add("active-link");
document.getElementById(tabname).classList.add("active-tab");
}
</script>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbwAOxvgHyPIpSmLeu11KJNgrxUvI1pnCzWvlZkuqOTjYD2auSnQwbuKONorNVn7OqCNyg/exec'
const form = document.forms['submit-to-google-sheet']
const msg=document.getElementById("msg")
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => {
msg.innerHTML="Sucessfull!";
setTimeout(function(){
msg.innerHTML=""
},5000)
form.reset()
})
.catch(error => console.error('Error!', error.message))
})
</script>
</body>
</html>