Spaces:
Running
Running
File size: 1,424 Bytes
d469365 e94557b d469365 e94557b d469365 e94557b d469365 e94557b d469365 e94557b d469365 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | document.addEventListener('DOMContentLoaded', () => {
// Form submission
const form = document.querySelector('form');
if (form) {
form.addEventListener('submit', (e) => {
e.preventDefault();
const name = form.querySelector('#name').value;
const phone = form.querySelector('#phone').value;
const business = form.querySelector('#business').value;
const tariff = form.querySelector('#tariff').value;
alert(`Спасибо, ${name}! Ваша заявка на тариф "${tariff}" принята. Мы свяжемся с вами в ближайшее время по телефону ${phone}.`);
form.reset();
// Here you would typically send the data to your backend
// fetch('/api/leads', {
// method: 'POST',
// body: JSON.stringify({ name, phone, business, tariff }),
// headers: { 'Content-Type': 'application/json' }
// });
});
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
}); |