0

I'm using shop engine like this demo: https://demo.abstore.pl/ When i add something to cart and then go to checkout https://demo.abstore.pl/order/checkout/cart/ i want to do something after i change any radio input. So, when i change any radio then will be showing loading and then i want to hide element when it be done. For example i want to hide purple button with id #proceedButton on the right panel. I tried this code, but it's not working. Button was hiding but after some time it's visible.

$('#message-div-out-ajax').bind('DOMSubtreeModified', function(e) {
        $('#proceedButton').css('display', 'none');
    });
LuckyLuck
  • 39
  • 5
  • please provide us with the needed html/css/javascript code. links are not very usefull and will most likely result in less answers, also please check these 2 links: https://api.jquery.com/click/ / https://api.jquery.com/fadeOut/ – Ramon de Vries Jun 16 '20 at 12:38
  • This will not solve the problem. I do not have access to the source files of this engine, which means that I have to adapt to how the rest works. I also have the impression that the whole basket is refreshed 2 times so that my code is executed first, and then the whole is downloaded again, apart from my code. I'm not so advanced to catch it, so maybe someone will find a way other than DOMSubtreeModified – LuckyLuck Jun 16 '20 at 12:46

1 Answers1

0

You could try something like this:

$('input:radio[name="delivery_method"]').change(function(){
    if ($(this).is(':checked')) {
        $('#proceedButton').css('display', 'none');
    }
});

This post has a really good detailed explanation of the above if you want to expand on this: Jquery If radio button is checked

Tony
  • 11
  • 3
  • Thank you for reply, but if you paste this code into console and change checked radio, than this button is hidden, but after that button is visible one more time. This happens when reloading the contents of the basket and it is a problem for me that I don't know how to make this button not appear again. I don't know if ajax is reloading it or something else ... – LuckyLuck Jun 17 '20 at 10:45