var chatTextArea = document.getElementById('chatTextArea');
function handleChatForm() {
	let chatInput = document.getElementById('chatInput');
	let myForm = document.getElementById('chatMessageForm').addEventListener(
		'submit', function (e) {
            e.preventDefault();
            
			// let user = getSelectedUser();
			// if (!isCheckedUser) {
			// 	window.alert('please select a user');
			// 	return;
			// }
			//				console.log('second user = ' + user);
			let messageContent = chatInput.value;
			let localDate = new Date();
			let messageLine = localDate.toLocaleDateString() + localDate.toLocaleTimeString() + 'fromUser' + ': ' + messageContent;
            chatTextArea.append(messageLine + "\n");
            chatTextArea.scrollTop = chatTextArea.scrollHeight;
		})
}

handleChatForm();

$(document).ready(function() {
    $('#action_menu_btn').click(function() {
        $('.action_menu').toggle();
    });
});