Clementine Design Studio

View Original

Autofill the Country in Address Form Field

If you hide the Country form field on a Squarespace form block using CSS, you’ll get an error when you try to submit it because the country is a required field. What if you know that your clients will likely always be in the same country? Unfortunately, you can’t make the country field optional, but you can use the code below to auto-populate this field to fill in your desired country.

This also works on custom product forms.

Put the code below into Settings -> Advanced -> Code Injection.

See this content in the original post

Customization:

To change the country, change ‘United States’ to the country of your choice.