document.querySelector('form').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent form submission for now
// Get the value of the Annual Revenue dropdown using the correct ID
var annualRevenue = document.getElementById('PXxCu9Djd27MjxhzJqfx').value;
// Check the value and redirect accordingly
if (annualRevenue === '$0 - $500,000') {
window.location.href = 'https://ecommerce.cloudsideaccounting.com/thank-you-below-500k'; // Redirect to the below 500,000 thank you page
} else if (annualRevenue === '$500,000+') {
window.location.href = 'https://ecommerce.cloudsideaccounting.com/thank-you-above-500k'; // Redirect to the 500,000+ thank you page
}
// Delay the form submission to ensure the redirect happens first
setTimeout(function() {
// Manually trigger form submission only after the redirect has occurred
event.target.submit(); // Submit the form after the redirect has been processed
}, 2000); // Adjust delay if necessary
});