Skip to content

Commit 22e6efe

Browse files
committed
Allow form submission and spell & grammar check
1 parent 261530e commit 22e6efe

6 files changed

Lines changed: 64 additions & 24 deletions

File tree

about.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
<div class="about-text">
2828
<h3 class="text-2xl font-semibold mb-4 text-text-dark">Our Commitment to Excellence</h3>
2929
<p class="mb-4 text-lg">GAAP Spices & Super Food LLP aspires to be a leading name in the global
30-
spice & super food market, dedicated to bringing the finest and most authentic Indian flavors to
31-
international tables. With decades of experience in corporate world, we pride ourselves building
30+
spice & superfood market, dedicated to bringing the finest and most authentic Indian flavors to
31+
international tables. With decades of experience in the corporate world, we pride ourselves on
32+
building
3233
deep-rooted relationships with local farms & several government bodies dedicated to promoting
3334
local farmers.</p>
3435
<p class="mb-4 text-lg">Our mission is to ensure that every pinch of spice & food product we export
@@ -48,11 +49,11 @@ <h3 class="text-2xl font-semibold mb-4 text-text-dark">Our Commitment to Excelle
4849

4950
<div class="mt-24 text-center bg-bg-light p-12 rounded-2xl">
5051
<h3 class="text-2xl font-semibold mb-4">Our History</h3>
51-
<p class="max-w-3xl mx-auto text-lg">Levaraging on the years of corporate eperience of its founders,
52+
<p class="max-w-3xl mx-auto text-lg">Leveraging the years of corporate experience of its founders,
5253
GAAP Spices & Super Food LLP, was founded on the principle of purity, with the noble intent to
5354
bridge the gap between local farmers and the global culinary market maintaining highest quality
54-
standrads. Aiming to be the most reliable exporters, serving clients across the globe with a
55-
portfolio of premium Indian spices & super food products.</p>
55+
standards. Aiming to be the most reliable exporters, serving clients across the globe with a
56+
portfolio of premium Indian spices & superfood products.</p>
5657
</div>
5758
</section>
5859
</main>

certifications.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<img src="assets/images/spices-board-india.jpg" alt="Spices Board India Logo"
3232
class="h-20 w-auto object-contain mix-blend-multiply">
3333
</div>
34-
<h3 class="text-xl font-semibold mb-2">Spices board Registered</h3>
34+
<h3 class="text-xl font-semibold mb-2">Spices Board Registered</h3>
3535
<p>To help realize India's mission to multiply its spices exports multifold by 2030.</p>
3636
</div>
3737
<div
@@ -55,7 +55,7 @@ <h3 class="text-xl font-semibold mb-2">Organic Compliance</h3>
5555

5656
<div class="mt-20 p-10 border-2 border-dashed border-accent-gold rounded-2xl">
5757
<h3 class="text-2xl font-semibold text-center mb-6">Testing & Lab Protocols</h3>
58-
<p class="text-lg mb-6 text-center">Committed to maintaining highest quality standrads of all its
58+
<p class="text-lg mb-6 text-center">Committed to maintaining highest quality standards of all its
5959
products through
6060
testing by NABL Accredited Laboratories.</p>
6161
</div>

contact.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="max-w-5xl mx-auto grid grid-cols-1 md:grid-cols-2 gap-16">
2828
<div class="contact-info">
2929
<h3 class="text-2xl font-semibold mb-4 text-text-dark">Get in Touch</h3>
30-
<p class="mb-8 text-lg">Interested in importing premium Indian spices & Super Food? Fill out the
30+
<p class="mb-8 text-lg">Interested in importing premium Indian spices & superfoods? Fill out the
3131
form or use our contact details below. Our export team will respond within 24 business hours.
3232
</p>
3333

@@ -51,19 +51,19 @@ <h3 class="text-2xl font-semibold mb-4 text-text-dark">Get in Touch</h3>
5151
<form id="enquiryForm" class="space-y-4">
5252
<div class="form-group">
5353
<label for="name" class="block mb-2 font-medium">Full Name</label>
54-
<input type="text" id="name"
54+
<input type="text" id="name" name="name"
5555
class="w-full p-3 border border-gray-300 rounded focus:outline-none focus:border-accent-gold transition-colors"
56-
required placeholder="John Doe">
56+
required placeholder="Will Smith">
5757
</div>
5858
<div class="form-group">
5959
<label for="email" class="block mb-2 font-medium">Business Email</label>
60-
<input type="email" id="email"
60+
<input type="email" id="email" name="email"
6161
class="w-full p-3 border border-gray-300 rounded focus:outline-none focus:border-accent-gold transition-colors"
62-
required placeholder="john@company.com">
62+
required placeholder="willsmith@gmail.com">
6363
</div>
6464
<div class="form-group">
6565
<label for="message" class="block mb-2 font-medium">Your enquiry</label>
66-
<textarea id="message"
66+
<textarea id="message" name="message"
6767
class="w-full p-3 border border-gray-300 rounded focus:outline-none focus:border-accent-gold transition-colors"
6868
rows="5" required placeholder="Tell us about your requirements..."></textarea>
6969
</div>

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1 class="text-5xl md:text-6xl font-bold mb-6 leading-tight">Traders & Exporter
3939
Our Vision</h2>
4040
</div>
4141
<p class="max-w-3xl mx-auto text-xl text-text-dark leading-relaxed">
42-
To be the world's most trusted partner in the Spice & Super Food trade, Bridging the Gap between local
42+
To be the world's most trusted partner in the Spice & Superfood trade, Bridging the Gap between local
4343
farming traditions and the global culinary market through uncompromising quality and sustainable
4444
practices.
4545
</p>

products.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h3 class="text-xl font-semibold mb-3 text-primary-green">Moringa Powder</h3>
6565
</div>
6666
<div class="p-6">
6767
<h3 class="text-xl font-semibold mb-3 text-primary-green">Others</h3>
68-
<p class="text-sm text-gray-600 mb-4">Red Chilli , Black pepper, Black cardamom, Green cardamom
68+
<p class="text-sm text-gray-600 mb-4">Red Chilli, Black pepper, Black cardamom, Green cardamom
6969
etc.</p>
7070
<a href="contact.html"
7171
class="text-accent-gold font-semibold inline-block hover:text-active-gold transition-colors">Enquire

script.js

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,63 @@ document.addEventListener('click', (e) => {
117117
});
118118

119119
// Simple Form Submission Handling
120+
// Form Submission Handling
121+
const FORMEASY_URL = "https://script.google.com/macros/s/AKfycbzYVsGnC2GBToA51_39F9Aiu409KRAZQhsaLQgR9dISVteOd2MQJ1_kqQP6OiGjsYaW/exec"; // TODO: Replace with your actual Formeasy/Google Script URL
122+
120123
const enquiryForm = document.getElementById('enquiryForm');
121124
if (enquiryForm) {
122-
enquiryForm.addEventListener('submit', (e) => {
125+
enquiryForm.addEventListener('submit', async (e) => {
123126
e.preventDefault();
124127

125-
// Show success message (demo)
126128
const btn = enquiryForm.querySelector('button');
127129
const originalText = btn.textContent;
128130

129-
btn.textContent = 'Enquiry Sent Successfully! ✓';
130-
btn.style.background = '#28a745';
131+
// Show loading state
132+
btn.textContent = 'Sending...';
133+
btn.disabled = true;
134+
135+
try {
136+
const formData = new FormData(enquiryForm);
137+
const data = Object.fromEntries(formData);
138+
139+
const response = await fetch(FORMEASY_URL, {
140+
method: 'POST',
141+
headers: {
142+
'Content-Type': 'text/plain;charset=utf-8',
143+
},
144+
body: JSON.stringify(data)
145+
});
146+
147+
if (!response.ok) {
148+
throw new Error('Network response was not ok');
149+
}
150+
151+
152+
// Success
153+
btn.textContent = 'Enquiry Sent Successfully! ✓';
154+
btn.style.background = '#28a745';
155+
156+
enquiryForm.reset();
131157

132-
enquiryForm.reset();
158+
setTimeout(() => {
159+
btn.textContent = originalText;
160+
btn.style.background = '';
161+
btn.disabled = false;
162+
}, 3000);
133163

134-
setTimeout(() => {
135-
btn.textContent = originalText;
136-
btn.style.background = '';
137-
}, 3000);
164+
} catch (error) {
165+
console.error('Error submitting form:', error);
166+
167+
// Error feedback
168+
btn.textContent = 'Error Sending. Try Again.';
169+
btn.style.background = '#dc3545';
170+
171+
setTimeout(() => {
172+
btn.textContent = originalText;
173+
btn.style.background = '';
174+
btn.disabled = false;
175+
}, 3000);
176+
}
138177
});
139178
}
140179

0 commit comments

Comments
 (0)