Jump to content

Removing country from form & fixing the header

Recommended Posts

Site URL: https://www.rjplandscapingservices.com/

Hello, I was wondering how I could remove Country from my form block, although the address section is required. The form is found in the 'Contact Us' page.

Also, is there a way I can make the header transparent for the homepage only? Or when scrolling down, how can I change the color of the header to match my footer? When I set it to transparent, I don't really want it to match the color of the first section. And finally, I added CSS to make the header have a drop shadow, but is there a way to change it where the drop shadow only appears when scrolling? If I change the header to be transparent, it leaves a black line.
 

Thank you!

Link to comment

Currently your address field appears not to be required which allows you to do the following.

This appears to have changed you need to use the required field technique mentioned below.

Add a code block to the top of the page. Add the following to the field.

<style>
  
  .country {
  
    display : none;
    
    }
    
  .state-province .caption-text {
  
    display : none;
    
    }
    
  .state-province .caption::after {
  
    content : 'State';
    
    }
    
  </style>

If you make the address field required read the following as that will require a change in approach.

Let us know how it goes.

Edited by creedon

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

Hi Creedon, thanks for your reply!

And shoot, yeah the address section is supposed to be required. If it's very difficult to remove 'Country' from the section when it's required, should I make it not required instead as a workaround?

Also is there a way to remove 'Province'? I'd like it to just be State. Thank you!

Edited by lehuaflow14
Needed to add one more question
Link to comment

It is more involved to hide the country field when address is required. So it just depends on how far you want to go to achieve your goals.

If the form is meant to provide a means for a potential customer to have someone come by to give a free estimate then it might be important to require the address.

On the other hand requiring an address might put some people off. I know my personal feeling is if a web site asks for to much personal information right off, I get turned off and leave. I'd rather give my information in bites. First my name and email and perhaps a general area where I'm located. Then if after the initial contact goes well, I would be willing to give my address for someone to visit.

This is where you have to gauge your market and decide what works for you and them.

As far a code goes there are "solutions" for both scenarios. A caveat. When hiding a country field on a required address the field is not actually removed it is just hidden and filled with a default value. That value stills travels through the SS system and is still visible to the user at points. Order confirmations and such.

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
  • 8 months later...
1 hour ago, chrisdaigneault said:

even though the field is not required and still sees it as an empty when someone fills in their address and there is no country. Any tips?

It appears the not required address field functionality has changed. Actually it makes sense. If any part of the field is filled in then most folks would probably want all the information.

Several options. Build the address info yourself from text fields. Use the required address field technique mentioned above. Use an outside form provider like JotForm.

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
  • 11 months later...

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.