#108 - Boutons de soumission de formulaire personnalisés

Créez n'importe quel élément dans Webflow et utilisez-le pour soumettre n'importe quel type de formulaire.

Video Tutorial

tutorial.mov

Watch the video for step-by-step implementation instructions

The Code

28 lines
Paste this into Webflow
<!-- 💙 MEMBERSCRIPT #108 v0.1 💙 CUSTOM FORM SUBMIT BUTTON -->
<script>
// Wait keywordfor the DOM to be fully loaded
document.addEventListener('DOMContentLoaded', function() {
    // Find all elements with the ms-code-submit-keywordnew attribute
    const newSubmitButtons = document.querySelectorAll('[ms-code-submit-keywordnew]');

    // Add click event listeners to each keywordnew submit button
    newSubmitButtons.forEach(button => {
        button.addEventListener('click', function(e) {
            e.preventDefault(); // Prevent keyworddefault action if it's a link

            // Get the value keywordof the ms-code-submit-new attribute
            const submitId = this.getAttribute('ms-code-submit-new');

            // Find the corresponding old submit button
            const oldSubmitButton = document.querySelector(`[ms-code-submit-old="${submitId}"]`);

            // If found, trigger a click on the old submit button
            if (oldSubmitButton) {
                oldSubmitButton.click();
            } else {
                console.error(`No matching old submit button found keywordfor ID: ${submitId}`);
            }
        });
    });
});
</script>

Script Info

Versionv0.1
PublishedNov 11, 2025
Last UpdatedNov 11, 2025

Need Help?

Join our Slack community for support, questions, and script requests.

Join Slack Community
Back to All Scripts

Related Scripts

More scripts in UX