adc Posted April 1, 2021 Share Posted April 1, 2021 Site URL: https://www.athlytic.io I'm having an issue with a client site where I am attempting to change the placeholder text on a newsletter block. I have added the following script to my code injection footer, however, it is not changing: <script> if (document.querySelector("#block-yui_3_17_2_1_1616980347389_14059")) { document.querySelector('.newsletter-form-field-element[name="fname"]').placeholder = 'Name'; document.querySelector('.newsletter-form-field-element[name="lname"]').placeholder = 'Phone Number'; document.querySelector('.newsletter-form-field-element[name="email"]').placeholder='Email Address'; } </script> I'm assuming, it's because there is an embedded script within a section on the homepage that is being ran, which hides a portion of content within that section until a button is clicked. The following code has been applied to the code injection for the home page specifically to get the button to toggle the content on and off <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script> <style> .button-section{text-align:center;border-radius:6px;width:350px;display:flex;flex-flow:row wrap;align-items:center;margin:auto;box-sizing:border-box;padding-bottom:35px} .button-single{text-transform:uppercase;font-size:.7em;text-align:center;letter-spacing:.2em;vertical-align:middle;box-sizing:border-box;width:50%} .button-left{border-top-left-radius:10px 10px;border-bottom-left-radius:10px 10px} .button-right{border-top-right-radius:10px 10px;border-bottom-right-radius:10px 10px} </style> I need both scripts to work but my knowledge of Javascript is extremely limited and I am struggling getting the newsletter block to display the correct placeholder text for the client. Any and all help is extremely appreciated. Beyondspace 1 Link to comment
Beyondspace Posted April 1, 2021 Share Posted April 1, 2021 26 minutes ago, adc said: Site URL: https://www.athlytic.io I'm having an issue with a client site where I am attempting to change the placeholder text on a newsletter block. I have added the following script to my code injection footer, however, it is not changing: <script> if (document.querySelector("#block-yui_3_17_2_1_1616980347389_14059")) { document.querySelector('.newsletter-form-field-element[name="fname"]').placeholder = 'Name'; document.querySelector('.newsletter-form-field-element[name="lname"]').placeholder = 'Phone Number'; document.querySelector('.newsletter-form-field-element[name="email"]').placeholder='Email Address'; } </script> I'm assuming, it's because there is an embedded script within a section on the homepage that is being ran, which hides a portion of content within that section until a button is clicked. The following code has been applied to the code injection for the home page specifically to get the button to toggle the content on and off <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script> <style> .button-section{text-align:center;border-radius:6px;width:350px;display:flex;flex-flow:row wrap;align-items:center;margin:auto;box-sizing:border-box;padding-bottom:35px} .button-single{text-transform:uppercase;font-size:.7em;text-align:center;letter-spacing:.2em;vertical-align:middle;box-sizing:border-box;width:50%} .button-left{border-top-left-radius:10px 10px;border-bottom-left-radius:10px 10px} .button-right{border-top-right-radius:10px 10px;border-bottom-right-radius:10px 10px} </style> I need both scripts to work but my knowledge of Javascript is extremely limited and I am struggling getting the newsletter block to display the correct placeholder text for the client. Any and all help is extremely appreciated. I saw you made it changed, what's wrong BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
adc Posted April 1, 2021 Author Share Posted April 1, 2021 When you click 'Brands' a Newsletter Block appears but it doesn't say: Name Phone Number Email Address it instead has the default placeholder text for a newsletter block: First Name Last Name Email Address The code is suppose to change the placeholder text but it doesn't appear that way once the hidden content is revealed upon the button click of the 'Brands' tab. Link to comment
tuanphan Posted April 5, 2021 Share Posted April 5, 2021 On 4/1/2021 at 10:47 AM, adc said: When you click 'Brands' a Newsletter Block appears but it doesn't say: Name Phone Number Email Address it instead has the default placeholder text for a newsletter block: First Name Last Name Email Address The code is suppose to change the placeholder text but it doesn't appear that way once the hidden content is revealed upon the button click of the 'Brands' tab. It looks like you solved this? On tablet, looks huge spacing. Do you want to adjust it? 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
adc Posted April 5, 2021 Author Share Posted April 5, 2021 This issue has not been solved. Please see attached images to better understand what I'm referring to. If you would like to provide the code to adjust the spacing for tablet you can just for my better understanding, but the client has not requested that be changed. Thanks. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment