请问这道题错在哪了? 按钮按了也没反应啊。。。帮帮我吧 这是作业啦。。~~~急急急!!

<% function checkempty()
if isempty(request.form("wenbenkuang")) or _
isempty(request.Form("wenbenkuang"))="" then
checkempty=true
strmsg="请输入内容!"
else
checkempty=false
strmsg=""
end if
end function

function button1_onclick
strwenbenkuang2=ltrim(strwenbenkuang)

end function

function button2_onclick
strwenbenkuang2=rtrim(strwenbenkuang)

end function

function button3_onclick
strwenbenkuang2=trim(strwenbenkuang)

end function

%>

</head>

<body>
<form method="post" action="Untitled-1.asp">
<table width="300" border="0" align="center">
<tr>
<td colspan="3">字符串首尾空格的处理</td>
</tr>
<tr>
<td width="62">字符:</td>
<td width="168"><input name="wenbenkuang" type="text"
value="<%=request.form("wenbenkuang")%>" size="40"></td>
<td width="56"></td>
</tr>
<tr>
<td><input type="button" name="button1" value="去左空格" ></td>
<td colspan="2"><input type="button" name="button2" value="去右空格" ></td>
</tr>
<tr>
<td colspan="3"><input type="button" name="button3" value="去除左右空格" ></td>
</tr>
</table>
</form>
<% dim strwenbenkuang, strwenbenkuang2
dim strmsg
if not checkempty() then

response.write("结果:")
response.write(strwenbenkuang&"的")
response.write("结果为"&strwenbenkuang2)
response.write(strmsg)
end if %>

</body>
</html>
虽然长 可很简单哦 。。。关于TRIM 的 问题

你写什么啊?<%%>里的 代码是来自服务器的,你怎么把事件对哦存放到服务器了啊,应该写在 javascript 里,你看看吧
温馨提示:答案为网友推荐,仅供参考
相似回答