document.getElementById('messageForm').addEventListener('submit', function(e) {
        const submitButton = e.target.querySelector('button[type="submit"]');
        submitButton.textContent = 'Posting...';
        submitButton.disabled = true;
    });
</script>
{% endblock %}