Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

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


hasher22

Question

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 0
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

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi! I'm Paul, an independent Squarespace Consultant since 2007 and founder of SF Digital, building the features that Squarespace didn't include. Our mini-extensions allow you to pick dates in any format, show prices in other currencies, take orders without payment or improve your cartI value honesty, integrity, transparency and respect . Links in my posts may refer to SF Digital products or may be affiliate links.

Link to comment
  • 0
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...