Answer the question
In order to leave comments, you need to log in
Why is the form submitted to the server despite return false?
Newbie, do not throw slippers)
Here is the js:
if (document.querySelector('.user-info__name').validity.valid && document.querySelector('.user-info__email').validity.valid && document.querySelector('.user-info__ms').validity.valid) {
if (sendData('handler.php', {
key: 6,
type: document.querySelector('.user-info__select').value,
name: document.querySelector('.user-info__name').value,
email: document.querySelector('.user-info__email').value,
text: document.querySelector('.user-info__ms').value
})) {
popup('Сообщение принято!', 'send.svg');
}
}
return false;
});
document.querySelector('.footer__submit').addEventListener('click', function () {
var email = document.querySelector('.footer__email');
if (email.validity.valid) {
if (sendData('handler.php', {key: 5,email: email.value})) {
popup('Спасибо! Вы подписаны!', 'send.svg');
email.value = "";
}
}
return false;
});
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