Jump to content

In Newsletter Form, is it possible to have just one field for Full Name instead of two (first name, last name)?

Go to solution Solved by tuanphan,

Recommended Posts

  • Solution

Add to Settings > Advanced > Code Injection > Footer

<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>
<style>
.newsletter-form-field-wrapper.field.last-name {
    display: none;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
On 11/18/2021 at 11:21 PM, Plano_Runner said:

This worked perfectly! Thank you. 

Is it also possible to modify the Comment Pop-UP Box? It would be great if the fields (then than name) we listed as *Optional or (Optional)

Thanks again for your help, and I'll be making another donation on your site this morning!

Post A Comment.png

New Sign-up with code.png

It looks like not possible to do this.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.