Untitled

webwizards avatar
webwizards
plain_text
02/26/2026 1:24 PM
1.2 KB
11
Indexable
add_action('wp_head', function() {
    ?>
    <script>
    document.addEventListener('DOMContentLoaded', function() {
        var form = document.querySelector('#signup .register');
        if (!form) return;

        // Clone and replace to nuke all existing event listeners
        var newForm = form.cloneNode(true);
        form.parentNode.replaceChild(newForm, form);

        // Also disable any delegated handlers on the submit button
        var submitBtn = newForm.querySelector('button[name="register"]');
        if (submitBtn) {
            submitBtn.addEventListener('click', function(e) {
                e.stopImmediatePropagation();
            }, true);
        }

        // Ensure the form submits normally
        newForm.addEventListener('submit', function(e) {
            e.stopImmediatePropagation();
            // Don't preventDefault — let it POST naturally
        }, true);
    });
    </script>
    <?php
}, 999);
Editor is loading...
Leave a Comment