您的位置:首页 > 其它

表单对象textarea内容的格式控制(回车、换行、空格)

2007-05-05 14:40 344 查看
常用代码 表单换行问题
test.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="test.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>

test.asp
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: