Validating Required Field when clicking "Buy It Now" dynamic button

New Member
2 0 0


On all of our product pages, we have a Delivery Date picker that is required. I was able to adjust to code to make that work when people select the "add to cart" button. However, when they select the "Buy it Now" button it will take them to checkout even if the delivery date field is blank. I have read that there is some additional code needed to do this. Can anyone help me with this?



Shopify Partner
1199 245 319

Hello @frontporchgift ,

1) On initial view make 'Buy now' button hidden. Now create a JS function which will detect change in date input field as any change happened change 'buy now' to display block.

2) Once page loaded add disabled attribute to 'buy now' button and as there is change happened in date picker field remove attribute disabled.

Hope these steps will give you idea to write code.


Want to modify or custom changes on store hire me.
Email:, Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate Click here (Its my paypal)