Baliplay slot
Baliplay hoki
Baliplay winner
Baliplay jackpot
baliplay
Baliplay gameasik
Baliplay link alternatif
Baliplay support
Baliplay slot zeus
Baliplay petir
Baliplay link resmi
baliplay
baliplay
baliplay
baliplay
indoluxury
baliplay
baliplay
balipoker333
baliplay
baliplay
indoluxury
balipoker333
SLOT GACOR
BALIPLAY
SLOT GACOR
BALIPLAY
SLOT GACOR
SLOT GACOR
INDOLUXURY
BALIPLAY
SLOT GACOR
BALIPLAY
BALIPLAY
BALIPOKER333
baliplay
baliplay
baliplay
indoluxury
baliplay
baliplay
balipoker333
balipoker333
baliplay
baliplay
indoluxury
indoluxury
balipoker333
baliplay
baliplay
balipoker333
balipoker333
balipoker333
balipoker333
baliplay
baliplay
baliplay
baliplay
balipoker333
balipoker333
balipoker333
baliplay
baliplay
slot gacor
slot gacor
slot88
baliplay
baliplay
baliplay
x88toto
x88toto
x88toto
slot thailand viral
situs slot gacor
link slot mahjong ways
slot server thailand
slot gacor server thailand
situs toto slot gacor
podomoro89
{
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
showMessage(data.message, data.success ? 'success' : 'error');
if (data.success) {
form.reset(); // Clear form on success
// Auto-hide success message after 5 seconds
setTimeout(() => {
hideMessage();
}, 5000);
}
})
.catch(error => {
console.error('Error:', error);
showMessage('Network error: Please try again later.', 'error');
})
.finally(() => {
setLoadingState(false);
});
});
function validateForm(form) {
const requiredFields = form.querySelectorAll('[required]');
let isValid = true;
// Reset previous error highlights
form.querySelectorAll('.field-error').forEach(field => {
field.classList.remove('field-error');
});
requiredFields.forEach(field => {
if (!field.value.trim()) {
field.classList.add('field-error');
isValid = false;
if (isValid === true) {
// Focus on first error
field.focus();
}
}
});
if (!isValid) {
showMessage('Please fill all required fields.', 'error');
}
return isValid;
}
function showMessage(message, type) {
messageDiv.textContent = message;
messageDiv.className = type;
messageDiv.style.display = 'block';
// Scroll to message for better UX
messageDiv.scrollIntoView({
behavior: 'smooth',
block: 'center'
});
}
function hideMessage() {
messageDiv.style.display = 'none';
}
function setLoadingState(loading) {
if (loading) {
submitButton.disabled = true;
submitButton.classList.add('loading');
submitButton.querySelector('.txt').textContent = 'Sending';
} else {
submitButton.disabled = false;
submitButton.classList.remove('loading');
submitButton.querySelector('.txt').textContent = 'contact us now';
}
}
});
// Optional: Add CSS for field errors
const style = document.createElement('style');
style.textContent = `
.field-error {
border-color: #dc3545 !important;
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}
`;
document.head.appendChild(style);