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

Datedropper javascript lightbox forms


shopshopshop

Question

Site URL: https://www.fieldandflorist.com/floral-delivery/sendflowers

Hey Ya'll — first off, I have really appreciated this whole community. Thank you for all your input on other user's posts.

I'm fairly new to coding and downloaded a .js date picker called datedropper — beautiful design if you haven't seen it. https://felixg.io/docs/products/datedropper-javascript. I'm trying to figure out how to get it to target and replace the date element in the lightbox form that pops up after you click 'Add to Cart' here: https://www.fieldandflorist.com/floral-delivery/sendflowers

I uploaded the js file to my site and attempted to install it to the header code injection of the page above with the code:

<head>
  ... 
  <!-- datedropper -->
  <script src="datedropper-javascript.js"></script>
</head> 

But I'm struggling to figure out the proper code formatting to get it to target and replace the date element in the lightbox form. The developer's page says to use this:

<input type="date">

<!-- datedropper init -->
<script>
new dateDropper({
  selector: 'input[type="date"]'
});
</script>

I believe that the element id is:

"date-yui_3_17_2_1_1603374970281_230035" class="form-item fields date required'

Any help would be appreciated. I'm super new to all of this. Thank you!

 

Link to post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Posted Images

1 answer to this question

Recommended Posts

  • 0

The developer's guide assumes that you adding the control to an element that already exists on the page. However, it's slightly more complex on Squarespace because Product Forms don't exist on the page. They are only created after a selects variants and attempts to add a product to their cart. If they change their mind to select another variant, the code needs to be called again.

If you'd like an alternative datepicker that has been built to work exclusively on Squarespace, including Product Forms, and doesn't require you to understand code, you may find our Datepicker useful. 

For more information and live examples, see the datepicker product page.

date-picker-tile.png.365f2e3ea01477c0f06bb3ae05d3171b.png

 

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digitalbuilding the features that Squarespace didn't include. 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.  Squarespace. I've been a loyal supporter of the platform since 2007. 

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...