Skip to content

Instantly share code, notes, and snippets.

@tripolskypetr
Created January 13, 2024 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripolskypetr/62f161e2274cb906da5e413556920d7a to your computer and use it in GitHub Desktop.
Save tripolskypetr/62f161e2274cb906da5e413556920d7a to your computer and use it in GitHub Desktop.
contact-form.html
<!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