Jump to content

Adding codeblock makes my site bugged and text out of whack!

Recommended Posts

  • hasher22 changed the title to How to add more postcodes to JS/HTML?
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

EDIT: Fixed! Idiot me had "</div>" all over the middle section, deleted those and site working fine!

Hello,

I added a simple code block with no CSS and no JS and it's making my site bug up.

For example, text spacing and height changes, button padding changes automatically. But when I remove the code block, everything goes back to normal.

My code block below. There are different IDs because I need them when I generate my JS for selected postcodes that are valid or not

<div class="postcode-checker"> 
  <div>
	<p>Enter your NSW postcode to check if we deliver in your area: <input type="text" id="postcode" placeholder="Postcode..."></p>
    <p id="wedeliver" style="display:none;" >
       <strong>Yes, we deliver in your area!</strong>
    </p>
    <p id="wedeliver1" style="display:none;" >
       <strong>Yes, we deliver in your area!</strong>
    </p>
    <p id="wedeliver2" style="display:none;" >
       <strong>Yes, we deliver in your area!</strong>
    </p>
    
    <p id="nodeliver" style="display:none;" > <strong>Sorry, we currently do not deliver to your area.</strong>
  </p>
  </div>
      <p id="nodeliver1" style="display:none;" > <strong>Sorry, we currently do not deliver to your area.</strong>
  </p>
  </div>
    <p id="nodeliver2" style="display:none;" > <strong>Sorry, we currently do not deliver to your area.</strong>
  </p>
  </div>
    <p id="nodeliver3" style="display:none;" > <strong>Sorry, we currently do not deliver to your area.</strong>
  </p>
  </div>

  <p id="errormsg" style="display:none;" >
      Please enter a valid NSW postcode
    </p>
    <p id="errormsg1" style="display:none;" >
      Please enter a valid NSW postcode
    </p>
</div>

 

Edited by hasher22
Link to comment
  • hasher22 changed the title to Adding codeblock makes my site bugged and text out of whack!
12 hours ago, hasher22 said:

I want to implement this on my website (postcode checker on codepen). How do I add more post codes in JS without adding new a new $ line for each post code?

I guess you want to show customers if you deliver to their NSW postcode? To how many postcodes do you deliver?

Edited by paul2009

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
12 hours ago, paul2009 said:

I guess you want to show customers if you deliver to their NSW postcode? To how many postcodes do you deliver?

Hey,

Thanks for the message, I implemented the way I wanted it on my website.

Just found out the restricted areas here are only for USA and Canada. Had to find a work around

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.