Spaces:
Running
Running
сделай чтобы эту заявку можно было отправить
Browse files- request.html +60 -30
request.html
CHANGED
|
@@ -54,8 +54,8 @@
|
|
| 54 |
</div>
|
| 55 |
|
| 56 |
<div class="bg-white p-8 md:p-12 rounded-xl shadow-md">
|
| 57 |
-
<form id="requestForm" class="space-y-6">
|
| 58 |
-
|
| 59 |
<div>
|
| 60 |
<label for="name" class="block text-gray-700 font-medium mb-2">Ваше имя*</label>
|
| 61 |
<input type="text" id="name" name="name" required class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
|
@@ -80,31 +80,33 @@
|
|
| 80 |
<div>
|
| 81 |
<label class="block text-gray-700 font-medium mb-2">Выберите услуги*</label>
|
| 82 |
<div class="space-y-3">
|
| 83 |
-
<div class="
|
| 84 |
-
<
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
<
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
<
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
<
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
</div>
|
| 99 |
-
|
| 100 |
-
<input type="checkbox" id="service5" name="services" value="Email-маркетинг" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 101 |
-
<label for="service5" class="ml-3 text-gray-700">Email-маркетинг</label>
|
| 102 |
-
</div>
|
| 103 |
-
<div class="flex items-center">
|
| 104 |
-
<input type="checkbox" id="service6" name="services" value="Аналитика" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 105 |
-
<label for="service6" class="ml-3 text-gray-700">Аналитика</label>
|
| 106 |
-
</div>
|
| 107 |
-
</div>
|
| 108 |
</div>
|
| 109 |
|
| 110 |
<div>
|
|
@@ -180,7 +182,6 @@
|
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
</footer>
|
| 183 |
-
|
| 184 |
<script>
|
| 185 |
VANTA.NET({
|
| 186 |
el: "#vanta-background",
|
|
@@ -198,10 +199,39 @@
|
|
| 198 |
spacing: 16.00
|
| 199 |
});
|
| 200 |
|
| 201 |
-
document.getElementById('requestForm').addEventListener('submit', function(e) {
|
| 202 |
e.preventDefault();
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
});
|
| 206 |
|
| 207 |
feather.replace();
|
|
|
|
| 54 |
</div>
|
| 55 |
|
| 56 |
<div class="bg-white p-8 md:p-12 rounded-xl shadow-md">
|
| 57 |
+
<form id="requestForm" class="space-y-6" action="https://formspree.io/f/xjvqnkne" method="POST">
|
| 58 |
+
<div class="grid md:grid-cols-2 gap-6">
|
| 59 |
<div>
|
| 60 |
<label for="name" class="block text-gray-700 font-medium mb-2">Ваше имя*</label>
|
| 61 |
<input type="text" id="name" name="name" required class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
|
|
|
| 80 |
<div>
|
| 81 |
<label class="block text-gray-700 font-medium mb-2">Выберите услуги*</label>
|
| 82 |
<div class="space-y-3">
|
| 83 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 84 |
+
<div class="flex items-center">
|
| 85 |
+
<input type="checkbox" id="service1" name="services" value="Таргетированная реклама" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 86 |
+
<label for="service1" class="ml-3 text-gray-700">Таргетированная реклама</label>
|
| 87 |
+
</div>
|
| 88 |
+
<div class="flex items-center">
|
| 89 |
+
<input type="checkbox" id="service2" name="services" value="SEO продвижение" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 90 |
+
<label for="service2" class="ml-3 text-gray-700">SEO продвижение</label>
|
| 91 |
+
</div>
|
| 92 |
+
<div class="flex items-center">
|
| 93 |
+
<input type="checkbox" id="service3" name="services" value="Контент-маркетинг" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 94 |
+
<label for="service3" class="ml-3 text-gray-700">Контент-маркетинг</label>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="flex items-center">
|
| 97 |
+
<input type="checkbox" id="service4" name="services" value="SMM продвижение" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 98 |
+
<label for="service4" class="ml-3 text-gray-700">SMM продвижение</label>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="flex items-center">
|
| 101 |
+
<input type="checkbox" id="service5" name="services" value="Email-маркетинг" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 102 |
+
<label for="service5" class="ml-3 text-gray-700">Email-маркетинг</label>
|
| 103 |
+
</div>
|
| 104 |
+
<div class="flex items-center">
|
| 105 |
+
<input type="checkbox" id="service6" name="services" value="Аналитика" class="h-5 w-5 text-primary rounded focus:ring-primary">
|
| 106 |
+
<label for="service6" class="ml-3 text-gray-700">Аналитика</label>
|
| 107 |
+
</div>
|
| 108 |
</div>
|
| 109 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
</div>
|
| 111 |
|
| 112 |
<div>
|
|
|
|
| 182 |
</div>
|
| 183 |
</div>
|
| 184 |
</footer>
|
|
|
|
| 185 |
<script>
|
| 186 |
VANTA.NET({
|
| 187 |
el: "#vanta-background",
|
|
|
|
| 199 |
spacing: 16.00
|
| 200 |
});
|
| 201 |
|
| 202 |
+
document.getElementById('requestForm').addEventListener('submit', async function(e) {
|
| 203 |
e.preventDefault();
|
| 204 |
+
|
| 205 |
+
const formData = new FormData(this);
|
| 206 |
+
const data = {};
|
| 207 |
+
formData.forEach((value, key) => {
|
| 208 |
+
if (key === 'services') {
|
| 209 |
+
if (!data[key]) data[key] = [];
|
| 210 |
+
data[key].push(value);
|
| 211 |
+
} else {
|
| 212 |
+
data[key] = value;
|
| 213 |
+
}
|
| 214 |
+
});
|
| 215 |
+
|
| 216 |
+
try {
|
| 217 |
+
const response = await fetch('https://formspree.io/f/xjvqnkne', {
|
| 218 |
+
method: 'POST',
|
| 219 |
+
headers: {
|
| 220 |
+
'Content-Type': 'application/json',
|
| 221 |
+
},
|
| 222 |
+
body: JSON.stringify(data),
|
| 223 |
+
});
|
| 224 |
+
|
| 225 |
+
if (response.ok) {
|
| 226 |
+
alert('Спасибо! Ваша заявка отправлена. Мы свяжемся с вами в ближайшее время.');
|
| 227 |
+
this.reset();
|
| 228 |
+
} else {
|
| 229 |
+
throw new Error('Ошибка отправки формы');
|
| 230 |
+
}
|
| 231 |
+
} catch (error) {
|
| 232 |
+
console.error('Error:', error);
|
| 233 |
+
alert('Произошла ошибка при отправке формы. Пожалуйста, попробуйте еще раз.');
|
| 234 |
+
}
|
| 235 |
});
|
| 236 |
|
| 237 |
feather.replace();
|