Skip to content

Commit

Permalink
complete form added
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiitu committed Feb 13, 2024
1 parent 8b8c020 commit af06c68
Show file tree
Hide file tree
Showing 39 changed files with 978 additions and 251 deletions.
6 changes: 6 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ <h3 class="text-light mb-0">Get In Touch</h3>
<i class="bi bi-envelope-open text-primary me-2"></i>
<a href="mailto:[email protected]"><p class="mb-0">[email protected]</p></a>
</div>
<div class="d-flex mb-2">
<i class="bi bi-search text-primary me-2"></i>
<a href="quotes.html">
<p class="mb-0">Ask Queries</p>
</a>
</div>
<!-- <div class="d-flex mb-2">
<i class="bi bi-telephone text-primary me-2"></i>
<p class="mb-0">+012 345 67890</p>
Expand Down
17 changes: 17 additions & 0 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ <h4 class="text-primary mb-0">+012 345 6789</h4>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="d-flex align-items-center wow fadeIn" data-wow-delay="0.4s">
<div class="bg-primary d-flex align-items-center justify-content-center rounded" style="width: 60px; height: 60px;">
<i class="fa fa-search text-white"></i>
</div>
<div class="ps-4">
<!-- <h5 class="mb-2">Email to get free quote</h5> -->
<a href="quotes.html"><h4 class="text-primary mb-0">Ask Queries</h4></a>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="d-flex align-items-center wow fadeIn" data-wow-delay="0.8s">
<!-- <div class="bg-primary d-flex align-items-center justify-content-center rounded" style="width: 60px; height: 60px;">
Expand Down Expand Up @@ -267,6 +278,12 @@ <h3 class="text-light mb-0">Get In Touch</h3>
<i class="bi bi-envelope-open text-primary me-2"></i>
<a href="mailto:[email protected]"><p class="mb-0">[email protected]</p></a>
</div>
<div class="d-flex mb-2">
<i class="bi bi-search text-primary me-2"></i>
<a href="quotes.html">
<p class="mb-0">Ask Queries</p>
</a>
</div>
<!-- <div class="d-flex mb-2">
<i class="bi bi-telephone text-primary me-2"></i>
<p class="mb-0">+012 345 67890</p>
Expand Down
82 changes: 63 additions & 19 deletions form.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,66 @@
/* overflow: hidden; */
/* background-color: #f1f1f1; */
}

.popup {
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.4);
display: none;
}

.popup-content {
background-color: white;
margin: 10% auto;
padding: 20px;
border: 1px solid #888888;
width: 30%;
font-weight: bolder;
}

.popup-content button {
display: block;
margin: 0 auto;
}

.show {
display: block;
}

h1 {
color: green;
}
</style>
</head>

<body>
<div class="form-container">
<form id="ai-solutions-form" action="https://sheetdb.io/api/v1/goq2oh0pijjd6" method="post" id="sheetdb-form">
<form id="ai-solutions-form" name="submit-to-google-sheet" method="post" id="sheetdb-form">
<h3>Contact Information</h3>
<div class="form-group">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="data[full-name]" required>
<input type="text" id="full-name" name="full-name" required>
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="data[email]" required>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="phone">Phone Number</label>
<input type="tel" id="phone" name="data[phone]" required>
<input type="tel" id="phone" name="phone" required>
</div>
<div class="form-group">
<label for="company-name">Company Name (if applicable)</label>
<input type="text" id="company-name" name="data[company-name]">
<input type="text" id="company-name" name="company-name">
</div>
<div class="form-group">
<label for="position">Position/Role (if applicable)</label>
<input type="text" id="position" name="data[position]">
<input type="text" id="position" name="position">
</div>
<hr>
<h3>Inquiry Details</h3>
Expand All @@ -142,7 +176,9 @@ <h3>Project Scope</h3>
<textarea id="specific-problem" name="specific-problem" rows="3"></textarea>
</div>
<hr>
<button type="button" class="collapsible"><center>Open Collapsible</center></button>
<button type="button" class="collapsible">
<center>Open Collapsible</center>
</button>
<div class="content">
<h3>Timeline</h3>
<div class="form-group">
Expand Down Expand Up @@ -237,6 +273,7 @@ <h3>Relevant document upload</h3>
</form>
</div>
<script>

var coll = document.getElementsByClassName("collapsible");
var i;

Expand All @@ -251,19 +288,26 @@ <h3>Relevant document upload</h3>
}
});
}
var form = document.getElementById('sheetdb-form');
form.addEventListener("submit", e => {
e.preventDefault();
fetch(form.action, {
method: "POST",
body: new FormData(document.getElementById("sheetdb-form")),
}).then(
response => response.json()
).then((html) => {
// you can put any JS code here
document.location.href = "https://www.example.com/thank-you.html";
});

const msg = document.getElementById('msg')
const scriptURL = 'https://script.google.com/macros/s/AKfycbxfGjN_d0EXSQw-8Q3FmVAEAzignyuxvuP18WnJjPP3UpB6tS2ELs0ZIov4K-W8p9ka/exec'
const form = document.forms['submit-to-google-sheet']


form.addEventListener('submit', e => {
e.preventDefault();
fetch(scriptURL, { method: 'POST', body: new FormData(form) })
.then(response => {
console.log('Success!', response);
// Redirect to https://edfoal.com/ after successful submission
window.location.href = 'https://edfoal.com/';
})
.catch(error => {
console.error('Error!', error.message);
// Handle error if needed
});
});

</script>

</body>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -899,12 +899,12 @@ <h3 class="text-light mb-0">Get In Touch</h3>
<p class="mb-0">[email protected]</p>
</a>
</div>
<!-- <div class="d-flex mb-2">
<div class="d-flex mb-2">
<i class="bi bi-search text-primary me-2"></i>
<a href="quotes.html">
<p class="mb-0">Ask Queries</p>
</a>
</div> -->
</div>
<!-- <div class="d-flex mb-2">
<i class="bi bi-telephone text-primary me-2"></i>
<p class="mb-0">+012 345 67890</p>
Expand Down
Loading

0 comments on commit af06c68

Please sign in to comment.