Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 1

Custom Newsletter Block w/ only First Name & Email


hypochandrea
Go to solution Solved by tuanphan,

Question

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 post
  • Answers 16
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Add to Code Injection Footer <script> window.Squarespace.onInitialize(Y, function(){ sfSeconds = document.querySelector('.last-name input'); sfSeconds.value = "NA"; sfSecondsField =

Posted Images

16 answers to this question

Recommended Posts

  • 3

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 by tuanphan
tag

You can send your question to my email to get detail answer. / How to Setup Password & Share URL 

-- I'm seriously sick. Off some time.

Link to post
  • 0

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 post
  • 0

HI there, I tried using the code but I keep getting an error syntax or something for the first line. Any suggestions?

Link to post
  • 0
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

You can send your question to my email to get detail answer. / How to Setup Password & Share URL 

-- I'm seriously sick. Off some time.

Link to post
  • 0

Hi! I think I'm doing something wrong. It still tells me the last name is required - image.png.40c7e2a986802a80de3e6df93645723a.png

I added this code in the footer section like this:

image.thumb.png.e4f2b31b3a8a324f4b5e540662554787.png

Are you able to tell what I did wrong?

 

Link to post
  • 0
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.

Hello I'm Thomas. I've been getting websites up and running for 26 years. I want to help you at whatever level meets your needs, from as little (if you're a DIYer) to as much as you need.

Link to post
  • 0
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 post
  • 0
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.

You can send your question to my email to get detail answer. / How to Setup Password & Share URL 

-- I'm seriously sick. Off some time.

Link to post
  • 0
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)

You can send your question to my email to get detail answer. / How to Setup Password & Share URL 

-- I'm seriously sick. Off some time.

Link to post
  • 0

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 by Kwamzilla
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


√ó
√ó
  • Create New...