Created
January 13, 2024 14:33
-
-
Save tripolskypetr/62f161e2274cb906da5e413556920d7a to your computer and use it in GitHub Desktop.
contact-form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>RealEstate Lead Funnel</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<form> | |
<label for="fio">Ф.И.О:</label><br /> | |
<input type="text" id="fio" name="fio" value="John" /><br /> | |
<label for="telefon">Телефон:</label><br /> | |
<input type="text" id="telefon" name="telefon" value="8999" /><br /> | |
<label for="comment">Комментарий:</label><br /> | |
<textarea id="comment" name="comment"></textarea> <br /> | |
</form> | |
<button onclick="submit()">Отправить</button> | |
<script> | |
function submit() { | |
const form = document.querySelector("form"); | |
const formData = new FormData(form); | |
const fio = formData.get("fio") || ""; | |
const telefon = formData.get("telefon") || ""; | |
const comment = formData.get("comment") || ""; | |
fetch("http://82.215.85.165:8087", { | |
method: "POST", | |
body: JSON.stringify({ | |
comment, | |
fio, | |
telefon, | |
status: "Холодный", | |
source: ["С сайта (Прочее)"], | |
}), | |
}); | |
alert('Контакт отправлен успешно') | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment