GET YOUR FREE QUOTE
+27
This is a custom code placeholder.
Switch to Preview or publish the page
to see how your code works.
Double-click to edit
<script type="text/javascript"> const LOCAL = false; const DIRECT_TO_BUYER = false; const LOCAL_ENDPOINT = "http://localhost:8080"; const REMOTE_ENDPOINT = "https://leadbyte.deno.dev"; const ENDPOINT = `${LOCAL ? LOCAL_ENDPOINT : REMOTE_ENDPOINT}/api${ DIRECT_TO_BUYER ? "/directToBuyer" : "/hooks/url" }`; const { href } = window.location; const inParams = new URLSearchParams(href.split("?")[1]); function paramsToObj(params) { const obj = {}; for (const [key, value] of params.entries()) obj[key] = value; return obj; } const paramsObj = paramsToObj(inParams); const outData = { href, ...paramsObj }; const form = document.querySelector(".custom-form") ?? document.querySelectorAll("form")[1] ?? document.querySelector("form"); console.assert(form, "form not found"); // Create a hidden submit input inside the form const submitInput = document.createElement("input"); submitInput.type = "submit"; submitInput.style.display = "none"; form.appendChild(submitInput); const btn = document.querySelector('button[type="submit"]'); const originalText = btn.innerText.slice(); const resetButton = () => { btn.innerText = originalText; btn.disabled = false; }; // There is a race condition (?) between submitting the form, and the preflight request of the fetch. btn.type = "button"; btn.onclick = async (e) => { btn.disabled = true; btn.innerText = "Loading..."; e.preventDefault(); const formData = new FormData(form); for (const [k, v] of formData) { if (!v) { resetButton(); return alert("Please complete all fields"); } else outData[k] = v; } let data = null; try { const resp = await fetch(ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(outData), }); data = await resp.json(); } catch (err) { console.log(err); } if (DIRECT_TO_BUYER && data && data.success) window.location.href = data.redirectURL; else submitInput.click(); resetButton(); }; </script>
Health Insurance and Accident Cover designed to give you peace of mind.
From personal injury to cancer protection and so much more, AIG protects the lifestyle that you and your family have worked so hard for.
Cancer Care Plan
Cancer is a journey you don’t have to take alone.

Protect your financial well-being while recovering from cancer. With 100% payout on diagnosis and full coverage at any stage of your illness.
Look out for the well-being of you and your family.

Designed to ease financial stress on you and your loved ones when unplanned illness happens. Get 100% coverage and payouts for five critical illnesses.
Critical Illness Cover
Lifetime Personal Accident
It’s time to think about the unthinkable.

When you can’t earn an income due to injury or death, we have you and your family covered. With up to R1 000 000 for immediate expenses, four unique plans and 50% extra benefit.
Daily Health Benefit
A cash pay-out to put you back on your feet.

Take away the worry of daily expenses when hospitalised with a daily cash pay-out when it matters most.
Get your quote today