I’m trying to have my own custom confirmation modal appear when I submit my form, but I cannot get it to submit. Only the gravity form button works and e.preventDefault() doesn’t work on it either and I’m really trying to eliminate the page from refreshing.
Can I not use my own button?
*const* inventorySubmit = document.querySelector(“.rep-modal-button”);
*const* realSubmit = document.getElementById(
“gform\_submit\_btuton\_11”
) as HTMLFormElement;
*const* formID = document.getElementById(“gform\_11”) as HTMLFormElement;
inventorySubmit?.addEventListener(“click”, (*e*) => {
e.preventDefault();
if (formID) {
realSubmit.disabled = true;
*// Attach an event listener for form submission*
formID.addEventListener(“submit”, () => {
console.log(“Form submitted successfully!”);
});
*// Submit the form*
formID.submit();
}
});

If you purchased a license for Gravity Forms you should reach out to their support. They’re very helpful.
You have a typo. Maybe that’s why?