|
<%@LANGUAGE="JavaScript"%>
<html>
<head>
<title>New message</title>
</head>
<!-- #INCLUDE FILE="INC/chatprocessing.asp" -->
<%
var strMessage = Request.Form("Message");
var sessionID = Request.Form("SessionID");
var moodType = Request.Form("Mood");
var roomID = Request.Form("RoomID");
// Avoid empty message addition.
if((strMessage.Count > 0) && (sessionID.Count > 0) && (moodType.Count > 0) && (roomID.Count > 0)) {
addMessage(roomID, sessionID, strMessage, moodType);
}
else {
sessionID = Request("SessionID");
roomID = Request("RoomID");
}
%>
<script language="JavaScript">
function checkVoice() {
var strText = document.frmNewMessage.Message.value;
if(strText.length < 1 || strText.length > 500) {
return false;
}
var sessionID = document.frmNewMessage.SessionID.value;
if(sessionID == "") {
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="SessionID" name="SessionID" value="<%=sessionID%>">
<input type="Hidden" id="RoomID" name="RoomID" value="<%=roomID%>">
<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.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here