Answer the question
In order to leave comments, you need to log in
Why doesn't the .serialize() method work on iPhone?
There is a certain form on the site, the data from which is sent using AJAX.
Form code:
<form id="uni-form-1" class="uni-form" action="unisender.php" method="post" target="_blank">
<div class="uni-form__title">Заполните форму,<br> чтобы начать консультацию</div>
<input type="text" id="uni-form__name" name="name" class="form-control" placeholder="Ваше имя" onkeyup="setCapitalLetter(this.value, this)" required="">
<input type="email" id="uni-form__email" class="form-control" name="email" placeholder="Ваш email" required="">
<button id="uni-form__send" name="send" class="btn btn-1 uni-form__send"><span>Начать сеанс!</span></button>
<div class="success-message" style="display: none;" ></div>
<div class="confidentiality uni-form__text"><span>Я гарантирую Вашу конфиденциальность. Эти данные нужны только для отправки Вам второй сесси Робота-психолога</span></div>
</form>
$(function(Subscribe) {
$('.uni-form').submit(function(e) {
var $form = $(this);
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
}).success(function(){
console.log('success');
}).fail(function() {
console.log('fail');
});
//отмена действия по умолчанию для кнопки submit
e.preventDefault();
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question