document.addEventListener('DOMContentLoaded', function () { const form = document.getElementById('pagehack-form'); const toastElement = document.getElementById('liveToast'); const toast = new bootstrap.Toast(toastElement); form.addEventListener('submit', function (event) { event.preventDefault(); const url = document.getElementById('url').value; if (!url) { alert('Please enter a URL.'); return; } // Show toast notification toast.show(); // You can add an AJAX call here later to submit the form asynchronously // For now, it just shows a notification. console.log('Form submitted with URL:', url); console.log('Language:', document.getElementById('language').value); // Optional: clear the form after submission // form.reset(); }); });