<a href="#popup:myform" class="showsform"></a>
<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
function callPopupAfterForm() {
setTimeout(function() {
window.tildaForm.closeSuccessPopup();
document.querySelector('.showsform').click();
}, 500);
};
if (document.readyState !== 'loading') {
us_sendFormAfterSuccess();
} else {
document.addEventListener('DOMContentLoaded', us_sendFormAfterSuccess);
};
function us_sendFormAfterSuccess() {
const forms = document.querySelectorAll('.uc-form-popup .js-form-proccess');
Array.prototype.forEach.call(forms, function (form) {
form.addEventListener('tildaform:aftersuccess', function () {
callPopupAfterForm();
});
});
};
})();
});
</script>
<style>
div#tildaformsuccesspopup {
opacity: 0 !important;
}
</style>