A
A
AriSokol2019-03-13 17:39:39
JavaScript
AriSokol, 2019-03-13 17:39:39

How to make iPhone 6 handle submitting form data on click?

There is a feedback form. js is being processed. The "submit" button works on all devices. On an iPhone, nothing happens when you press it. {cursor:pointer} is written in styles.

<form class="fofm" action="">
<input type="text" required="" placeholder="Имя" name="txtname">
<input type="tel" pattern="^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$" required="" placeholder="Телефон" name="txtphone">
<label><input type="checkbox">Я не робот</label>
<input type="hidden" name="valTrFal" class="valTrFal" value="valTrFal_disabled">
<input type="submit" onclick="" class="button" value="Отправить" disabled="disabled" name="btnsend">
</form>

$(".fofm").submit(function() {
    var str = $(this).serialize();
    $.ajax({
      type: "POST",
      url: "contact.php",
      data: str,
      success: function(msg) {
        if(msg == 'ok') {
          $('.popup2, .overlay').css('opacity','1');
          $('.popup2, .overlay').css('visibility','visible');
          $('.popup').css({'opacity':'0','visibility':'hidden'});
        }
        else {
          $('.popup2 .window').html('<h5>Ошибка</h5><p>Сообщение не отправлено, убедитесь в правильности заполнение полей</p>');
          $('.popup2, .overlay').css('opacity','1');
          $('.popup2, .overlay').css('visibility','visible');
          $('.popup').css({'opacity':'0','visibility':'hidden'});
        }
      }
    });
    return false;
  });

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav Lyskov, 2019-03-13
@Vlatqa

Your form sends a get request, and the script receives post
Well, this is at least

P
Pavel, 2019-03-13
@PavelMonro

This is not all the code, and do you think someone will write everything from scratch? Do a demo.
If nothing happens, then most likely the attribute disabled = "disabled" is not removed from the button

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question