Sign In

Latest Deals

document.addEventListener('DOMContentLoaded', function() {
    // Select all buttons that should trigger the coupon data population.
    // Replace '.your-coupon-button-class' with the actual CSS class you gave your button in Elementor.
    const couponButtons = document.querySelectorAll('.your-coupon-button-class'); 

    couponButtons.forEach(button => {
        button.addEventListener('click', function(event) {
            event.preventDefault(); // Prevents the button's default action (e.g., submitting the form prematurely)

            const card = this.closest('.coupon-card');
            if (card) {
                const data = card.querySelector('.coupon-data');
                const form = card.querySelector('form');

                if (data && form) {
                    // Pulling only the product title for testing
                    const productTitle = data.dataset.productTitle;
                    
                    // Assuming your Gravity Forms hidden field for the product title has the name "input_1"
                    // You must verify this in your Gravity Forms field settings.
                    const hiddenField = form.querySelector('input[name="input_1"]');
                    
                    if (hiddenField) {
                        hiddenField.value = productTitle;
                        console.log('Product title set to:', hiddenField.value); // For debugging: check the browser console
                    }
                }
            }
        });
    });
});

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Thanks for your interest

Your Digital Loyalty Cards on the Way From

Knock Em Down Tree Service

if you did not recieve a text with your personal deal card click below to download it.

Digital Deal Card link