Mantis Posted February 24, 2020 Share Posted February 24, 2020 Site URL: http://www.hausline.be/contact I have a problem where the script that changes the default values of the contact form (first name and last name) are changed to my language, but it is only executed when I refresh the page. On first load the scripts doesn't change anything. This is the code I used, after some extensive searching here on the forums. <script> function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { sqsFirstName = document.getElementsByClassName("caption")[0].innerHTML; myFirstName = sqsFirstName.replace("First Name", "Voornaam"); document.getElementsByClassName("caption")[0].innerHTML = myFirstName; sqsLastName = document.getElementsByClassName("caption")[1].innerHTML; myLastName = sqsLastName.replace("Last Name", "Naam"); document.getElementsByClassName("caption")[1].innerHTML = myLastName; }); </script> Anyone know where I went wrong? Thanks. Link to comment
tuanphan Posted February 24, 2020 Share Posted February 24, 2020 Try disable this: https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading#toc-enable-or-disable-ajax Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Mantis Posted March 1, 2020 Author Share Posted March 1, 2020 Thank you, that did the trick I think :-). Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.