v0.1

UX
#95 - Konfetti auf Klick
Lass lustiges Konfetti auf Klick fliegen!
Erstellen Sie ein beliebiges Element in Webflow und verwenden Sie es, um eine beliebige Art von Formular zu übermitteln.
Watch the video for step-by-step implementation instructions
<!-- 💙 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>More scripts in UX