// Function to handle form submission // Capture form data // Send the data to the PHP backend using AJAX // Define a callback function to handle the AJAX response // Successful response from the server // You can update the UI or show a confirmation message to the user here // Error response from the server // Send the form data // Event listener for when the chat is maximized // Add an event listener for the live chat form submission event.preventDefault(); // Prevent the default form submission behavior handleFormSubmission(); // Handle form submission // Event listener for when a message is sent // Capture form data when a message is sent (if needed)