Updated form and messages
This commit is contained in:
+22
-14
@@ -15,7 +15,7 @@
|
|||||||
href="https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600&display=swap"
|
href="https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
>
|
>
|
||||||
<link rel="stylesheet" href="styles.css?version=reusable-classes">
|
<link rel="stylesheet" href="styles.css?version=form-refinement">
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/gsap.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/gsap.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/ScrollTrigger.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/ScrollTrigger.min.js"></script>
|
||||||
@@ -374,26 +374,26 @@
|
|||||||
<input type="hidden" name="access_key" value="e13bd9eb-b409-4b3f-936c-a938a701ee2e">
|
<input type="hidden" name="access_key" value="e13bd9eb-b409-4b3f-936c-a938a701ee2e">
|
||||||
<div class="field-grid">
|
<div class="field-grid">
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label class="label-uppercase" for="inquiry-name">Your name</label>
|
<label class="label-uppercase" for="name">Your name</label>
|
||||||
<input id="inquiry-name" type="text" autocomplete="name" required>
|
<input id="name" name="name" type="text" autocomplete="name" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label class="label-uppercase" for="inquiry-email">Email</label>
|
<label class="label-uppercase" for="email">Email</label>
|
||||||
<input id="inquiry-email" type="email" autocomplete="email" required>
|
<input id="email" name="email" type="email" autocomplete="email" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="checkbox" name="botcheck" class="hidden" style="display: none;">
|
<input type="checkbox" name="botcheck" class="hidden" style="display: none;">
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label class="label-uppercase" for="inquiry-organization">Describe the space</label>
|
<label class="label-uppercase" for="organization">Describe the space</label>
|
||||||
<input id="inquiry-organization" type="text" autocomplete="organization" required>
|
<input id="organization" name="organization" type="text" autocomplete="organization" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label class="label-uppercase" for="inquiry-project-brief">What do you have in mind?</label>
|
<label class="label-uppercase" for="project-brief">What do you have in mind?</label>
|
||||||
<textarea id="inquiry-project-brief" rows="5" required></textarea>
|
<textarea id="project-brief" name="project-brief" rows="5" required></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="button-filled label-uppercase" type="submit">
|
<button class="button-filled label-uppercase" type="submit">
|
||||||
@@ -401,10 +401,12 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p class="target-notice" id="contact-confirmation" class="hidden">
|
<div class="grid-trailing-form vertical-centering hidden" id="contact-confirmation">
|
||||||
|
<p class="target-notice" id="confirmation-message">
|
||||||
Please wait...
|
Please wait...
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
@@ -426,7 +428,6 @@
|
|||||||
decoding="async"
|
decoding="async"
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
<!--<p class="text-muted-small">For the welcome you offer and the memories you make.</p>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="link-stack" aria-label="Footer navigation">
|
<nav class="link-stack" aria-label="Footer navigation">
|
||||||
@@ -453,8 +454,10 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
var success = false;
|
||||||
const inquiryForm = document.getElementById("inquiry-form");
|
const inquiryForm = document.getElementById("inquiry-form");
|
||||||
const confirmation = document.getElementById("contact-confirmation");
|
const confirmation = document.getElementById("contact-confirmation");
|
||||||
|
const confirmationMessage = document.getElementById("confirmation-message");
|
||||||
|
|
||||||
inquiryForm.addEventListener("submit", (event) => {
|
inquiryForm.addEventListener("submit", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -476,16 +479,21 @@
|
|||||||
.then(async (response) => {
|
.then(async (response) => {
|
||||||
let json = await response.json();
|
let json = await response.json();
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
confirmation.innerHTML = "Thank you for your interest! Noel Design Atelier will review your inquiry and contact you soon.";
|
success = true;
|
||||||
|
confirmationMessage.innerHTML = "Thank you for your interest! Noel Design Atelier will review your inquiry and contact you soon.";
|
||||||
} else {
|
} else {
|
||||||
confirmation.innerHTML = json.message;
|
console.error('Error:', json);
|
||||||
|
confirmationMessage.innerHTML = json.message;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
confirmation.innerHTML = "An error occurred. Please try again.";
|
confirmationMessage.innerHTML = "An error occurred. Please try again.";
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
if (success) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
inquiryForm.reset();
|
inquiryForm.reset();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
confirmation.classList.add("hidden");
|
confirmation.classList.add("hidden");
|
||||||
|
|||||||
+4
-1
@@ -83,6 +83,10 @@ ul {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vertical-centering {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* Compose layout, typography, surfaces, and components independently.
|
/* Compose layout, typography, surfaces, and components independently.
|
||||||
Responsive placement belongs to descriptive layout variants; IDs are anchors only. */
|
Responsive placement belongs to descriptive layout variants; IDs are anchors only. */
|
||||||
.grid-twelve-columns {
|
.grid-twelve-columns {
|
||||||
@@ -743,7 +747,6 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.target-notice {
|
.target-notice {
|
||||||
display: none;
|
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-left: 0.25rem solid var(--color-noel-red);
|
border-left: 0.25rem solid var(--color-noel-red);
|
||||||
|
|||||||
Reference in New Issue
Block a user