表单对象TEXTAREA内容的格式控制(回车、换行、空格)
类别: ASP教程
<!--1.htm-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="t.asp">
<p>
<textarea name="textarea" cols="50" rows="10"></textarea>
</p>
<p> <input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</p>
</form>
</body>
</html>
<!--t.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
dim msg
msg=request.Form("textarea")
msg=replace(msg,vbcrlf,"<br>")
msg=replace(msg," "," ")
response.write msg
%>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="t.asp">
<p>
<textarea name="textarea" cols="50" rows="10"></textarea>
</p>
<p> <input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</p>
</form>
</body>
</html>
<!--t.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
dim msg
msg=request.Form("textarea")
msg=replace(msg,vbcrlf,"<br>")
msg=replace(msg," "," ")
response.write msg
%>
</body>
</html>
- 上一篇: 利用XSL和ASP实现XML文档在线编辑
- 下一篇: 一个高效的数据分页的存储过程
-= 资 源 教 程 =-
文 章 搜 索