Skip to content
There are no jobs matching your search
No jobs found for you please register with us and we will contact you
document.addEventListener('DOMContentLoaded', function () {
function enableSubmitOnError() {
var forms = document.querySelectorAll('.elementor-form');
forms.forEach(function (form) {
var button = form.querySelector('button[type="submit"]');
if (!button) return;
form.addEventListener('submit', function () {
// disable while submitting
button.disabled = true;
button.textContent = 'Submitting...';
// continuously check every 500ms for visible errors
var interval = setInterval(function () {
var error = form.querySelector('.elementor-message-danger, .elementor-message-error');
if (error && error.offsetParent !== null) {
// found an error, re-enable button
button.disabled = false;
button.textContent = 'Submit';
clearInterval(interval);
}
}, 500);
// stop checking after 10 seconds to avoid infinite loop
setTimeout(function () {
clearInterval(interval);
}, 10000);
});
});
}
// run immediately and after Elementor dynamic content
enableSubmitOnError();
document.addEventListener('elementor/popup/show', enableSubmitOnError);
});