Jump to content

Change the "name" fields

Recommended Posts

Good morning; I'm brand new to Squarespace. Our operation is stealth, I'm just trying to throw-up a logo and a 'join the mailing list" form. All I want is to collect people's names and email. I'm using the website and form builder to add a "name" field, but it forces me to have a "first name" and "last name" field. We have an international audience, and this creates three problems:

 

1. Calling one's given name "first name" is highly regional;

2. Many folks don't strictly divide their names in this way;

3. It does not provide a field for honourific, so we appear rude to anyone not from California

Is there some way to make the name field simply a one box text field, and we can tell people to put their full name (including honourific) into that field? 

Link to comment
  • Replies 1
  • Views 234
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

@djw92 Hi! Try adding this code snippet under Website Tools > Code Injection > Header. This snippet will remove the last name field, leaving only one input field for the name and changing the input placeholder for the first name to 'Name'. You'll require a business plan to add this code.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
 const lastNameField = document.querySelectorAll('.last-name')
 const lastName = document.querySelectorAll('.last-name input')
  $(document).ready(function(){
     lastName.forEach(lname => {
     lname.value = "-"
  })
     lastNameField.forEach(lnameField => {
     lnameField.style.display = "none"
  })
   $('input[name="fname"]').attr('placeholder','Name');   
});
</script>
<style>
.newsletter-form-field-wrapper.last-name {
    display: none;
}
</style>

Let me know how it goes. Thanks! 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.