|
<%@LANGUAGE="JavaScript"%>
<html>
<head>
<title>New message</title>
</head>
<!-- #INCLUDE FILE="INC/chatprocessing.asp" -->
<%
var strMessage = Request.Form("Message");
var userID = Request.Form("UserID");
var moodType = Request.Form("Mood");
// Avoid empty message addition.
if((strMessage.Count > 0) && (userID.Count > 0) && (moodType.Count > 0)) {
addMessage(userID, strMessage, moodType);
}
else {
if((userID.Count == 0) || (userID == "")) {
userID = Request("UserID");
if((userID.Count > 0)) {
strMessage = "Welcome " + userID + "!"
addSysMessage(strMessage);
}
}
}
%>
<script language="JavaScript">
function checkVoice() {
var strText = document.frmNewMessage.Message.value;
if(strText.length < 1 || strText.length > 500) {
return false;
}
var userID = document.frmNewMessage.UserID.value;
if(userID == "") {
return false;
}
return true;
}
function submitWithMood(moodType) {
if(checkVoice()) {
document.frmNewMessage.Mood.value = moodType;
document.frmNewMessage.submit();
}
}
</script>
<body>
<form id="frmNewMessage" name="frmNewMessage" action="newmessage.asp"
method="post">
<textarea id="Message" name="Message" cols="60" rows="3"></textarea>
<input type="Hidden" id="UserID" name="UserID" value="<%=userID%>">
<input TYPE="Hidden" NAME="Mood" ID="Mood" VALUE="0">
<input type="Button" value="Send" onclick="submitWithMood(0)">
<a HREF="javascript:submitWithMood(1)"><img SRC="img/mood1.gif" BORDER="0" title="good" WIDTH="15" HEIGHT="15"></a>
<a HREF="javascript:submitWithMood(2)"><img SRC="img/mood2.gif" BORDER="0" title="bad" WIDTH="15" HEIGHT="15"></a>
<a HREF="javascript:submitWithMood(3)"><img SRC="img/mood3.gif" BORDER="0" title="ok" WIDTH="15" HEIGHT="15"></a>
<a HREF="javascript:submitWithMood(4)"><img SRC="img/mood4.gif" BORDER="0" title="malice" WIDTH="15" HEIGHT="15"></a>
<a HREF="javascript:submitWithMood(5)"><img SRC="img/mood5.gif" BORDER="0" title="nice" WIDTH="15" HEIGHT="15"></a><br>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.