hypochandrea Posted December 30, 2019 Share Posted December 30, 2019 Hi, I was hoping that someone here could help me 😁 I would like to customize my newsletter block so that it ONLY requires "First Name" and "Email" No need for Last name. Can that be hidden through some code? Any help is greatly appreciated! spiridonakou.com Link to comment
tuanphan Posted December 30, 2019 Share Posted December 30, 2019 Last name is currently require or optional? 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
Pooks Posted January 31, 2020 Share Posted January 31, 2020 Currently it is first and last name required or no name at all. I would be really interested in the ability to just have first name and email as well. Link to comment
Solution tuanphan Posted February 1, 2020 Solution Share Posted February 1, 2020 (edited) Add to Code Injection Footer <script> window.Squarespace.onInitialize(Y, function(){ sfSeconds = document.querySelector('.last-name input'); sfSeconds.value = "NA"; sfSecondsField = document.querySelector('.last-name'); sfSecondsField.style.display = "none"; }); </script> code by @paul2009, edited some lines by me. 7 hours ago, Pooks said: Currently it is first and last name required or no name at all. I would be really interested in the ability to just have first name and email as well. Edited February 1, 2020 by tuanphan tag Pooks, kim.eastwillow, SodaCreekDigital and 1 other 3 1 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
Pooks Posted February 1, 2020 Share Posted February 1, 2020 thank I will give it a go Link to comment
Pooks Posted February 1, 2020 Share Posted February 1, 2020 Works like a dream thanks so much for your help! Link to comment
MGN Posted April 30, 2020 Share Posted April 30, 2020 HI there, I tried using the code but I keep getting an error syntax or something for the first line. Any suggestions? Link to comment
tuanphan Posted May 1, 2020 Share Posted May 1, 2020 6 hours ago, MGN said: HI there, I tried using the code but I keep getting an error syntax or something for the first line. Any suggestions? Add to Home > Settings > Advanced > Code Injection > Footer NOT CUSTOM CSS 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
PEARLERwork Posted August 27, 2020 Share Posted August 27, 2020 Hello! This didn't work for me on Squarespace 7.1. Any ideas? Thank you! 𝓚𝓪𝓽𝓲𝓮 ✦✦ ⓅⒺⒶⓇⓁⒺⓇ.ⓌⓄⓇⓀ ➸ Link to comment
tuanphan Posted August 28, 2020 Share Posted August 28, 2020 On 8/27/2020 at 12:35 PM, pearler1570048501 said: Hello! This didn't work for me on Squarespace 7.1. Any ideas? Thank you! Can you share link to page where you use form? We can check easier. 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
JennyJenny Posted October 1, 2020 Share Posted October 1, 2020 Hi! I think I'm doing something wrong. It still tells me the last name is required - I added this code in the footer section like this: Are you able to tell what I did wrong? Link to comment
creedon Posted October 1, 2020 Share Posted October 1, 2020 1 hour ago, JennyJenny said: Are you able to tell what I did wrong? Please give us the URL for the page where you want to suppress the Last Name field. If you've not already done so please set up a site-wide password. Post the password here and then we can take a look at your issue. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
michenator Posted October 9, 2020 Share Posted October 9, 2020 On 2/1/2020 at 1:02 AM, tuanphan said: Add to Code Injection Footer <script> window.Squarespace.onInitialize(Y, function(){ sfSeconds = document.querySelector('.last-name input'); sfSeconds.value = "NA"; sfSecondsField = document.querySelector('.last-name'); sfSecondsField.style.display = "none"; }); </script> code by @paul2009, edited some lines by me. Hello! This worked for me on the newsletter block on my homepage, (thank you!) but I have another newsletter block on my contact page, and the removal of the last name does not reflect there. Any way to make this global for all newsletter blocks? I can share site and pw if necessary. Using Harris Template in York Family, so it's not a footer block like the Brine sites. Link to comment
tuanphan Posted October 10, 2020 Share Posted October 10, 2020 11 hours ago, michenator said: Hello! This worked for me on the newsletter block on my homepage, (thank you!) but I have another newsletter block on my contact page, and the removal of the last name does not reflect there. Any way to make this global for all newsletter blocks? I can share site and pw if necessary. Using Harris Template in York Family, so it's not a footer block like the Brine sites. Can you share link to contact page? We can check easier. 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
michenator Posted October 12, 2020 Share Posted October 12, 2020 On 10/10/2020 at 6:05 AM, tuanphan said: Can you share link to contact page? We can check easier. Thank you! https://tankarselfstorage.squarespace.com/contact // pw: packlikeapro Newsletter blocks are at bottom of Contact page and bottom of Home page. Link to comment
tuanphan Posted October 13, 2020 Share Posted October 13, 2020 18 hours ago, michenator said: Thank you! https://tankarselfstorage.squarespace.com/contact // pw: packlikeapro Newsletter blocks are at bottom of Contact page and bottom of Home page. I think above code should work for all forms. If it still doesn't work, try disable Ajax Loading (Home > Design > Site Styles > Ajax Loading) 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
KwameAndCo Posted October 22, 2020 Share Posted October 22, 2020 (edited) Did you ever sort the 7.1 error @tuanphan ? Your older code seems to work fine: Quote const lnames = document.querySelectorAll('.last-name input') const lnameFields = document.querySelectorAll('.last-name') $(document).ready(function(){ lnames.forEach(lname => { lname.value = "-" }) lnameFields.forEach(lnameField => { lnameField.style.display = "none" }) }); Edited October 22, 2020 by Kwamzilla Work With Me 🖥️💻📱 Please remember to tag me so that I get a notification and respond to your help requests. If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. You can also thank me or make requests by buying me a coffee ☕. (Caffeine fuels me to take more requests) For Squarespace Tips & Tricks, visit @squareskills (Youtube 📺 Tutorials) For Premium and FREE plugins, visit Squareskills (Plugin Store) 🧩 Some links may be affiliate/referral links. Link to comment
newstaircase Posted May 13, 2021 Share Posted May 13, 2021 (edited) On 2/1/2020 at 6:02 AM, tuanphan said: Add to Code Injection Footer <script> window.Squarespace.onInitialize(Y, function(){ sfSeconds = document.querySelector('.last-name input'); sfSeconds.value = "NA"; sfSecondsField = document.querySelector('.last-name'); sfSecondsField.style.display = "none"; }); </script> code by @paul2009, edited some lines by me. The code here seems to work well on the surface, however it sets the value of Last Name for the new contact, literally to the text string 'NA', rather than it being null/empty, which is not quite the desired behaviour. You would need to take care not to include Last Name in any of your correspondence, to avoid emailing contacts something like, "Hello Ffion NA"! Edited May 13, 2021 by newstaircase Added screenshot Link to comment
tuanphan Posted May 14, 2021 Share Posted May 14, 2021 19 hours ago, newstaircase said: The code here seems to work well on the surface, however it sets the value of Last Name for the new contact, literally to the text string 'NA', rather than it being null/empty, which is not quite the desired behaviour. You would need to take care not to include Last Name in any of your correspondence, to avoid emailing contacts something like, "Hello Ffion NA"! Add new code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> const lnames = document.querySelectorAll('.last-name input') const lnameFields = document.querySelectorAll('.last-name') $(document).ready(function(){ lnames.forEach(lname => { lname.value = "-" }) lnameFields.forEach(lnameField => { lnameField.style.display = "none" }) }); </script> taylorroy 1 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
kkurtz Posted May 24, 2021 Share Posted May 24, 2021 Site URL: https://midlandfoodtours.ca How do I delete the 'last name' field in a newsletter block? It's on the website page linked to the 'Subscribe for Updates' button on my homepage. I've tried different custom CSS in several forum posts but have not had any luck. website password: mft4567* Link to comment
tuanphan Posted May 26, 2021 Share Posted May 26, 2021 On 5/24/2021 at 7:30 PM, kkurtz said: Site URL: https://midlandfoodtours.ca How do I delete the 'last name' field in a newsletter block? It's on the website page linked to the 'Subscribe for Updates' button on my homepage. I've tried different custom CSS in several forum posts but have not had any luck. website password: mft4567* It looks like you solved this? 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
kkurtz Posted May 27, 2021 Share Posted May 27, 2021 Thanks for being so thorough on the site! I'd still like to know how to have a newsletter block with just blocks for first name and email address. Until I know how to do it, I went with the option to only require an email address. I do need help to fix the five other issues. Some of them were issues on a tablet, and I've never seen my site displayed on a tablet before. Thank you! Link to comment
tuanphan Posted May 28, 2021 Share Posted May 28, 2021 18 hours ago, kkurtz said: Thanks for being so thorough on the site! I'd still like to know how to have a newsletter block with just blocks for first name and email address. Until I know how to do it, I went with the option to only require an email address. I do need help to fix the five other issues. Some of them were issues on a tablet, and I've never seen my site displayed on a tablet before. Thank you! Can you enable name field? We can check easier 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
kkurtz Posted May 28, 2021 Share Posted May 28, 2021 I've enabled the name field again. Link to comment
tuanphan Posted June 16, 2021 Share Posted June 16, 2021 On 5/29/2021 at 4:23 AM, kkurtz said: I've enabled the name field again. Use this new code <script> window.Squarespace.onInitialize(Y, function(){ sfSeconds = document.querySelector('.last-name input'); sfSeconds.value = " "; sfSecondsField = document.querySelector('.last-name'); sfSecondsField.style.display = "none"; }); </script> Code by Sf.digital 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment