This commit is contained in:
Flatlogic Bot 2025-11-11 22:00:14 +00:00
parent 7794e16d3d
commit 3df9715e25

View File

@ -54,11 +54,11 @@ if ($chat_with_id) {
<footer class="p-3 bg-light border-top">
<div class="container-fluid">
<form id="message-form">
<form id="message-form" onsubmit="sendMessage(event)">
<div class="input-group">
<input type="hidden" name="receiver_id" value="<?php echo $chat_with_id; ?>">
<input type="text" name="message" class="form-control" placeholder="Type a message..." required>
<button class="btn btn-primary" type="submit">Send</button>
<button class="btn btn-primary" type="submit" id="send-button">Send</button>
</div>
</form>
</div>
@ -122,8 +122,8 @@ if (document.getElementById('message-form')) {
console.log("Connection closed!");
}
messageForm.addEventListener('submit', function(e) {
e.preventDefault();
function sendMessage(event) {
event.preventDefault();
const message = messageInput.value;
if (message) {
const data = {
@ -142,7 +142,7 @@ if (document.getElementById('message-form')) {
messageInput.value = '';
}
});
}
}
</script>
<?php