Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   Помогите со счетчиком и кнопкой очистки!! (https://javascript.ru/forum/jquery/55327-pomogite-so-schetchikom-i-knopkojj-ochistki.html)

staseward 23.04.2015 11:40

Помогите со счетчиком и кнопкой очистки!!
 
Вложений: 1
Помогите сделать дату по левому краю, ниже боковой панели должно выводиться количество сообщений отправленных.
Ниже панели должна располагаться кнопка очистки боковой панели.
И помогите добавить простейшую капчу. чат не он-лайн а прост в реальном времени сам пишу и сам читаю.. :) Ниже мой код:

<!DOCTYPE html>
<html>
<head>
<title>Comet Server - Пример php чата</title>
<meta charset="utf-8">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<style type="text/css">
#form {
	width: 800px;
	height: 500px;
	border: 1px solid grey;
}

#header {
	background-color: #D9EDF7;
	width: 800px;
	height: 40px;
}

h1 {
	font-size: 20px;
	font-weight: bold;
	font-style: italic;
	color: blue;
	margin: 0 0;
	padding-left: 15px;
	padding-top: 5px;
}

input {
	margin-left: 15px;
}

textarea {
	width: 152px;
	height: 20px;
	margin-left: 27px;
	padding: 0 0;
}

#username {
	width: 75px;
	height: 17px;
	font-size: 16px;
	font-weight: bold;
}

#message {
	width: 75px;
	height: 17px;
	font-size: 16px;
	font-weight: bold;
	margin: 0 0;
	padding: 0 0;
}

#sideLeft {
	width: 400px;
	height: 210px;
	float: left;
}

#WebChatFormForm {
	width: 360px;
	height: 400px;
	float: left;
	margin: 20 20;
	margin-top: 20px;
	border: 1px solid grey;
}

</style>
</head>


<body>

<div id="form">
	<div id="header">
		<h1> Чат </h1>
	</div>
	
	<div id="sideLeft">
	
	</br>
	<span id="username">Username:</span> <input type="text" id="WebChatNameID"></br></br>
	<span id="message">Message:</span> <textarea id = "WebChatTextID"></textarea></br></br>
    
    <input type="button" onclick="web_send_msg();" value="Send" > </br></br>
	
	
	</div>
	
	<div id="WebChatFormForm">  </div>
   		
</div>
    
    <script>
         
         function web_send_msg()
         {
             
             var text = $("#WebChatTextID").val();
             var name = $("#WebChatNameID").val();
			 var date = new Date();
			 var time = date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();          
            
             $("#WebChatTextID").val("");  
             
             $("#WebChatFormForm").append("<p style='margin-left: 15px;'><b style='color: blue;'>"+name+": </b>"+text+"<b style='align: right;'>"+time+"</b></p>");
                     
         }
         
            
    </script>
</body>
</html>


Часовой пояс GMT +3, время: 14:19.