Liquid, JavaScript, themes, sales channels
Hello Everyone,
I have cart notes enabled on my site and I recently added some code to make the cart notes field required in order to checkout. The code works, however, if someone tries to checkout without putting anything in the field, it will display " please enter required field" and then the checkout button displays the spinning wheel graphic. Once the customer enters info into the order notes I would like for the spinning wheel to stop but it persists even though text has been entered into the required field. You can click the spinning wheel and it will bring you to checkout but visually it looks as if the button is broken due to the spinning wheel graphic.
I would like to know if there is any way to disable that spinning wheel graphic completely or what code I need to change in order for the text field to update the checkout button so it stops displaying the spinning wheel graphic once the required text is entered into the field.
I have attached images of the two areas where I manipulated code, the curser highlights the exact lines that were manipulated, and an screenshot of the resulting error.
Hello @DanielKoburn ,
Yes there is way.
You have to use a JS 'keyup' function
e.g.
// When someone press a click in textarea after clicking the checkout button
$("#yourtextarea-id").keyup(function(){
// Hide the loader which is on checkout button.
$("#loader-ID").hide();
});
Thanks
Thanks so much for the response, I am not a total novice when it comes to code, but pretty dang close. Do you think you could point me in the right direction as to where to place this code?
Hey Thanks for your response,
I am still trying to implement this code and cannot figure it out. Could you perhaps tell me in which file or area to paste this code? Also, I am able to find my text area ID easily, however, I am having trouble finding the loader ID.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024