富翁们,快来帮忙啊~~弄了16个小时都没弄好(50分)

  • 主题发起人 turbopeng
  • 开始时间
T

turbopeng

Unregistered / Unconfirmed
GUEST, unregistred user!
<input type=&quot;checkbox&quot;
value=&quot;ON&quot;
name=&quot;C1&quot;
<%if 0=0 then
%>checked<%end if%>>
就是上面那句话,我的意思是,如果0等于0,则让这个CHECKBOX打勾,否则则不打勾。
但是试了无数次,都以失败告终。
显示的结果是,逻辑代码成了文本被显示出来了。问了很多人,都解决不了。
下面是执行结果,怎么会这样呢?
□checked
 
分开写:
<% if 0=0 then
%>
<input type=&quot;checkbox&quot;
value=&quot;ON&quot;
name=&quot;C1&quot;
checked>
<% else
%>
<input type=&quot;checkbox&quot;
value=&quot;ON&quot;
name=&quot;C1&quot;
>
<% end if %>
或者改为
<form name=&quot;form1&quot;
method=&quot;post&quot;
action=&quot;&quot;>
<input type=&quot;radio&quot;
name=&quot;radiobutton&quot;
value=&quot;radiobutton&quot;>
<input name=&quot;c1&quot;
type=&quot;checkbox&quot;
value=&quot;checkbox&quot;

<% if (true) then
%><%=&quot;checked&quot;%><% end if%>>
</form>
都测试成功了!
 
蓝叶菱你好,你的代码我试过了。
在窗口上出现了两个 checkbox ,一个是点勾的,一个是没点勾的,怎么才能只出现一个 checkbox 呢?
谢谢!
 
我使用你的方法测试没有问题呀。
是不是你没有在IIS的环境下测试,而直接在Frontpage下测试的?
<input type=&quot;checkbox&quot;
value=&quot;ON&quot;
name=&quot;C1&quot;
<%if 0=0 then
%>checked<%end if%>>
 
是的,我没在IIS下测试,我现在试试。谢谢你的提醒。
 
在IIS下试过了,也是这个样子呀。
 
什么啊,我测试都通过了
我测试你的程序也没有问题,你不需要在代码做文章了,你可以看看服务了。
看样子你的服务器根本没有解析。
<%@LANGUAGE=&quot;VBSCRIPT&quot;
CODEPAGE=&quot;936&quot;%>//这个有没有。
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>无标题文档</title>
</head>
<body>
<form name=&quot;form1&quot;
method=&quot;post&quot;
action=&quot;&quot;>
<input type=&quot;radio&quot;
name=&quot;radiobutton&quot;
value=&quot;radiobutton&quot;>
<input type=&quot;checkbox&quot;
value=&quot;ON&quot;
name=&quot;C1&quot;
<%if 0=0 then
%>checked<%end if%>>

</form>
</body>
</html>
你是不是没有开启WIN2003的IIS的ASP服务。
 
晕哦,你嵌入了ASP代码要在支持ASP的http服务器上来调试,你肯定是直接打开这个页面看到的效果吧?还有,0=0是什么意思,你直接if true then
就行了嘛
 
果然是没有开启WIN2003的IIS的ASP服务,谢谢。解决了!
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
734
import
I
I
回复
0
查看
709
import
I
I
回复
0
查看
467
import
I
顶部