You can send your questions to my email to get faster answer in 24 hours (free).
Buy me a coffee

Autosubmit Form with URL and Redirect to New Page

Need to change Text Field ID + Form Block ID

<script>
window.addEventListener("load", (event) => {
    const formBlock = document.querySelector('#block-yui_3_17_2_1_1737482349953_6080');
    if (!formBlock) return;
    
    const triggerInputChange = (inputElement, value) => {
        const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
            window.HTMLInputElement.prototype, 
            "value"
        ).set;
        nativeInputValueSetter.call(inputElement, value);
        const inputEvent = new Event("input", { bubbles: true });
        inputEvent.composedPath = () => [inputElement, inputElement.parentElement];
        inputElement.dispatchEvent(inputEvent);
    }

    const pageUrl = window.location.href;
    const urlField = formBlock.querySelector('input#text-f535e910-2e3d-4abc-b7b1-252457138352-field');
    
    if (urlField) {
        urlField.closest('.form-item').style.display = 'none';
        triggerInputChange(urlField, pageUrl);
        
        const form = urlField.closest('form');
        if (form) {
            triggerInputChange(urlField, pageUrl);
            
            setTimeout(() => {
                const submitButton = form.querySelector('.form-submit-button');
                if(submitButton) {
                    const submitEvent = new Event('submit', {
                        bubbles: true,
                        cancelable: true
                    });
                    
                    form.dispatchEvent(submitEvent);
                    
                    setTimeout(() => {
                        window.location.href = '/letsgo'; 
                    }, 1000);
                }
            }, 3000);
        }
    }
});
</script>

 

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder

You can send questions directly to email: [email protected] to get faster response.