Помогите разобраться с обратной формой
Что написано не правильно? внизу указал на что жалуется
<h4>Заказать звонок</h4>
</div>
<div class="ajax_form" id="clback">
<div class="field">
<input id='name_name' type="text" name="name" required="">
<label for="phone_phone">Ваше имя</label>
</div>
<div class="field">
<input type="tel" id="phone_phone" name="phone" required="">
<label for="phone_phone">Телефон</label>
</div>
</div>
<button onclick="phone()" id='phone-button' class="submit ">Заказать обратный звонок</button>
<input type="hidden" name="af_action" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$("#phone-button").click(function() {
phone = document.getElementById('phone_phone').value
name = document.getElementById('name_name').value
document.getElementById('phone-button').innerHTML = 'Отправляется...'
$.get("https://taxigreenline.ru/phone/", {name:name, phone:phone})
.done(function (data) {
document.location.href = "https://taxigreenline.ru/yes/";
после чего получаю вот такие ошибки
Uncaught TypeError: phone is not a function at HTMLButtonElement.onclick ((index):1345) onclick @ (index):1345 jquery.min.js:2 GET https://taxigreenline.ru/phone/?name=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80&phone=89787635718 net::ERR_FAILED`
Ответы (1 шт):
Автор решения: Igor
→ Ссылка
Я уже говорил Вам:
уберите onclick="phone()" из
<button onclick="phone()" id='phone-button' class="submit ">
В Вашем коде нет функции phone.