A
A
Alexander Ivanov2020-12-02 10:55:20
1C-Bitrix
Alexander Ivanov, 2020-12-02 10:55:20

Why is the ios subscribe button not working?

I use the bitrix.subscribe.edit component. On a PC, the mailing list works correctly, but on the phone (in my case, iphone) the subscribe button does not work, initially it should be inactive, after clicking on the check box it becomes active, but when you click on the check box, nothing happens, and in the case if the button is already active, nothing happens when you click on it.
5fc7475b84ffc929872572.png

I tried to modernize the handler in the script by adding event handling, pressing the touchstart screen, It did not work out.

BX.ready(function(){

  try {

  var iOS = navigator.userAgent.match(/iPhone|iPad|iPod/i);
  var event = "click";

  if(iOS != null)
      event = "touchstart";

  if(document.getElementById('subscription_user_agreement'))
    document.getElementById('subscription_user_agreement').addEventListener(event, function(){
      var subscr_btn = document.getElementById('subscription_submit_btn');
      if(subscr_btn.hasAttribute('disabled'))
      {
        subscr_btn.removeAttribute('disabled');
      
      }
      else
      {
        subscr_btn.setAttribute('disabled', 'disabled');

      }
    });

  } catch(e) {}

});


P/S Found that the problem is that the IPHONE opens a new screen when pressed, but keeps the old one, if I return to the previous form screen, everything works correctly there.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question