Jump to content

Check Box to Unlock Button

Recommended Posts

  • Replies 4
  • Views 765
  • Created
  • Last Reply
3 minutes ago, atownwings said:

Site URL: https://www.atownwings.com/columbus

Is there a way to insert a checkbox that must be checked in order for a button to be unlocked?

Example:

☐ I agree I am ordering from the xxxx location.

(Order Online button)

The order button would only be clickable when the user checks the box.

You can place the checkbox as required value in product form lightbox, it won't allow to add to cart if button not checked

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
6 minutes ago, bangank36 said:

You can place the checkbox as required value in product form lightbox, it won't allow to add to cart if button not checked

Thanks for the quick reply. How do I do this? It is not a product—the button links to a third-party page where the customer can place an online order.

Link to comment
27 minutes ago, atownwings said:

Thanks for the quick reply. How do I do this? It is not a product—the button links to a third-party page where the customer can place an online order.

Oh I see, so the code block can help.

Add this to Site Design->Custom css

.order-online-block {
  text-align: center;
}
.order-online-block [class*='sqs-block-button-container'] {
  margin-top: 10px;
  pointer-events: none;
  opacity: 0.7;  
}
.order-online-block input:checked + label + [class*='sqs-block-button-container'] {
  pointer-events: auto;
  opacity: 1;  
}

And add new code block where you place the button

<div class="order-online-block">
  <input type="checkbox" id="location-confirm" name="location-confirm" value="location">
  <label for="location-confirm"> I agree I am ordering from the xxxx location.</label>
  <div class="sqs-block-button-container--center" data-animation-role="button" data-alignment="center" data-button-size="large" id="yui_3_17_2_1_1615252679288_72">
	<a href="https://www.micropay-online.com/ordering/restaurant/menu?restaurant_uid=ceece2e1-cd66-4625-a3cb-570b5ad87d83" class="sqs-block-button-element--large sqs-block-button-element" data-initialized="true">Columbus, GA Online Order</a>
</div>
  
</div>

image.png.58e63075e7d547b61728d5041163d31e.png

image.png.190b848c6248cd18d7eeb0ace6a91b94.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
3 minutes ago, bangank36 said:

Oh I see, so the code block can help.

Add this to Site Design->Custom css


.order-online-block {
  text-align: center;
}
.order-online-block [class*='sqs-block-button-container'] {
  margin-top: 10px;
  pointer-events: none;
  opacity: 0.7;  
}
.order-online-block input:checked + label + [class*='sqs-block-button-container'] {
  pointer-events: auto;
  opacity: 1;  
}

And add new code block where you place the button


<div class="order-online-block">
  <input type="checkbox" id="location-confirm" name="location-confirm" value="location">
  <label for="location-confirm"> I agree I am ordering from the xxxx location.</label>
  <div class="sqs-block-button-container--center" data-animation-role="button" data-alignment="center" data-button-size="large" id="yui_3_17_2_1_1615252679288_72">
	<a href="https://www.micropay-online.com/ordering/restaurant/menu?restaurant_uid=ceece2e1-cd66-4625-a3cb-570b5ad87d83" class="sqs-block-button-element--large sqs-block-button-element" data-initialized="true">Columbus, GA Online Order</a>
</div>
  
</div>

image.png.58e63075e7d547b61728d5041163d31e.png

image.png.190b848c6248cd18d7eeb0ace6a91b94.png

Wow!

That worked perfectly. Thank you for your quick, helpful, and concise response. The best!

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.