Lepro Signature, 1 Young Ave, Houghton Estate, Gauteng info@ink-agency.co.za
Get In Touch

Ready to take your brand to the next level?

Whether you're an entrepreneur looking to bridge the gap to mainstream media or an organisation ready to dominate your niche, The InKredible Experience is here to make it happen. Reach out today to discover how our tailored marketing strategies can amplify your voice and build the brand authority you deserve. Let’s start crafting your high-impact success story together.

Facebook WhatsApp Instagram LinkedIn Call 067 625 6286
document.getElementById('contactForm').addEventListener('submit', async function(e) { e.preventDefault(); const form = this; const submitBtn = document.getElementById('contactSubmit'); const label = submitBtn.querySelector('.submit-label'); const loading = submitBtn.querySelector('.submit-loading'); const statusDiv = document.getElementById('formStatus'); // Toggle loading UI submitBtn.disabled = true; label.classList.add('d-none'); loading.classList.remove('d-none'); statusDiv.textContent = ""; try { const formData = new FormData(form); const response = await fetch(form.action, { method: form.method, body: formData, redirect: 'manual' // Prevents the browser from following the PHP headers automatically }); // Parse the redirected destination to check outcomes const redirectUrl = response.url || ''; if (redirectUrl.includes('sent=1')) { statusDiv.className = "mt-3 text-success"; statusDiv.textContent = "Your message has been sent successfully!"; form.reset(); } else if (redirectUrl.includes('error=')) { const urlParams = new URLSearchParams(redirectUrl.split('?')[1]); statusDiv.className = "mt-3 text-danger"; statusDiv.textContent = urlParams.get('error') || "An error occurred. Please try again."; } else { // Fallback check if response.url isn't exposed by the server redirect rules statusDiv.className = "mt-3 text-success"; statusDiv.textContent = "Thank you! Your message has been sent."; form.reset(); } } catch (error) { statusDiv.className = "mt-3 text-danger"; statusDiv.textContent = "Network error. Please check your internet connection."; } finally { // Reset button UI submitBtn.disabled = false; label.classList.remove('d-none'); loading.classList.add('d-none'); } });