如何在<textarea>里换行和清屏
liuyan_index.asp<html>
<head>
<title>欢迎光临小型聊天室</title>
<meta http-equiv=Content-Language content=zh-cn>
</head>
<body topmargin=100 bgcolor=ffffff>
<table border=1 cellpadding=0 cellspacing=0 width="500">
<tr>
<td align="center">聊天室用户登陆</td>
</tr>
</table>
<form method=POST action="liuyan_chat.asp">
<table border=0 cellpadding=0 cellspacing=0 width="500">
<tr align="center">
<td>
用户名:
<input type="text" name="username" size=19 maxlength="10"><br>
密码:<input type="passWord" name="password" size=19 maxlength="10"><br>
<input type=submit value="登陆" name="submit">
<input type=reset value="重写" name="reset">
</td>
</tr>
</table>
</form>
</body>
</html>
liuyan_chat.asp
<%
name=request.form("username")
password=request.form("password")
session("sname")=name
if name=""then
response.redirect"liuyan_index.asp"
end if
%>
<html>
<head><title>聊天室</title></head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<frameset rows="500,*">
<frame name="liuyan_show" src="liuyan_show.asp">
<frame name="liuyan_input" src="liuyan_input.asp">
</frameset>
</html>
liuyan_input.asp
<html>
<head>
<title>欢迎光临小型聊天室</title>
<script language="javascript">
function OnShow()
{
if(form1.putword.value==""){
alert("请输入内容");
form1.putword.focus;
return false;
}
return true;
}
</script>
</head>
<body>
<center>
<meta http-equiv=Content-Language content=zh-cn>
<form method="post" action="liuyan_show.asp" target="liuyan_show" name="form1" onSubmit="return OnShow()">
<p><font=ffff00><input name="uuu" type="text" value="<%=Session("sname")%>" size="5"></font>
说:<input name="putword" type="text">
<input type="submit" name=formsubmit value="发送">
<input type="reset" name=formreset value="重发">
<input type="submit" name="button" value="清屏">
</font>
</form>
</center>
</body>
</html>
liuyan_show.asp
<%
mytalk=trim(request.form("putword"))
if mytalk<>""then
application.lock
'application("show")=Session("sname")&":"&mytalk&application("show")
'application("show")=Session("sname")&":"&mytalk&application("show")&vbCrlf&""
application("show")=Session("sname")&":"&mytalk&vbCrlf&application("show")
application.unlock
else
'if mytalk="" Then
'response.Write("<script>alert("qingshuruneirong")")
'Response.Write( " <script language= 'javascript '> alert( 'ad '); </script")
application("show")=""
end if
%>
<html>
<head>
<title>欢迎光临小型聊天室</title>
</head>
<body>
<center>
<pre>
<meta http-equiv=Content-Language content=zh-cn>
<textarea name="textarea" id="textarea" cols="50" readonly="readonly" rows="20">
<%=application("show")%></textarea>
</pre>
</center>
</body>
</html>
清屏一个在前台,一个在后台,点清屏时连带着吧putword 也提交了
[ 本帖最后由 a768841969 于 2011-4-13 11:14 编辑 ]