一个小问题!高手请帮忙!解决马上结贴!
<tr>
<td nowrap>特殊推荐</td>
<td ><select name="special">
<option <% if special="false" then Response.Write"selected" %> value="false">否</option>
<option <% if special="true" then Response.Write"selected" %> value="true">是</option>
/select></td>
</tr>
1)这是修改页面的一段代码,修改时要显示原来数据库的信息,不知道怎么回事
遇到文本框的字段就可以显示原来信息,可是遇到下拉框时,信息始终不正确,就
象上面的这段代码。只要是和否2种可能,但无论什么情况(有时应该是“是”)他都显示为“否”。我已经做了一些改变,可是问题还是没解决。
2)<td nowrap>中的nowrap是什么意识啊!
下面的代码也是同样问题:
<tr>
<td>图书类别:
<select name="select">
<%for i=1 to rsclass.recordcount %>
<option value="<%=rsclass("class_id")%>"><%=rsclass("class_name")%></option>
<% rsclass.movenext
next
rsclass.close
%>
</select></td>
</tr>
这个下拉框是从一个table中读出的数据,但是始终是显示第一种。
问题点数:0、回复次数:7Top
1 楼kyn(kyn)回复于 2003-09-03 16:03:57 得分 0
1)情況,請把結果頁的HTML源代碼看一看就明白了,
2)nowrap是在表格中的字符不跳行,只在一行中顯示
Top
2 楼xiaobird1(Vincent)回复于 2003-09-03 16:03:58 得分 0
<tr>
<td nowrap>特殊推荐</td>
<td ><select name="special">
<option <% if special="false" then Response.Write"selected" %> value="false">否</option>
<option <% if special="true" then Response.Write"selected" %> value="true">是</option>
/select></td>
</tr>
最好这样写:
<tr>
<td nowrap>特殊推荐</td>
<td ><select name="special">
<% if special="false" then%>
<option value="false" selected>否</option>
<option value="true">是</option>
<% elseif special="true" then %>
<option value="false">否</option>
<option value="true" selected>是</option>
<% end if%>
</select></td>
</tr>Top
3 楼xiaobaowu(很想和你吹吹风(抵制日货))回复于 2003-09-03 16:06:54 得分 0
1)关于第一个,你把变量special换个名试试,它和下拉框重名了.
2)nowrap就是不换行的意思,有时字多的话,表格会多行显示,用它就不会了.
第二个,你把rsclass.recordcount 打出来,看看它的值正确吗?
Top
4 楼csdntoll(伊人美食LadyFood.Com)回复于 2003-09-03 16:07:55 得分 0
<select name="special">
<option <% if trim(special)="false" then Response.Write"selected" end if %> value="false">否</option>
<option <% if trim(special)="true" then Response.Write"selected" end if %> value="true">是</option>
</select>
Top
5 楼csdntoll(伊人美食LadyFood.Com)回复于 2003-09-03 16:09:07 得分 0
<select name="special">
<option <% if trim(special)="false" then Response.Write"selected" end if %> value="false">否</option>
<option <% if trim(special)="true" then Response.Write"selected" end if %> value="true">是</option>
</select>
Top
6 楼119311canoe()回复于 2003-09-03 16:30:35 得分 0
小鸟:你的说法还不行,这回显示出来全都是 “是”了!本来“否”的也变成“是”了
阿标:你和我的写法结果一样,还是全都是“否”
xiaobaowu(很想和你吹吹风) :
读数据库正确,显示出来了6条书的类型,
大家还要帮忙看看,其实重点是第2个下拉框的问题,他比这个难啊!他的值都是从数据库中读出来的。
大家可以看看这段代码(正确的),和我的基本一样,但我的就不行,他的就行????
<TR>
<TD align=middle vAlign=top>性别</TD>
<TD vAlign=top>
<SELECT id=ryxb name=ryxb style="HEIGHT: 22px; WIDTH: 300px">
<OPTION <% if ryxb="1" then Response.Write "selected" %> value=1>男</OPTION>
<OPTION <% if ryxb="0" then Response.Write "selected" %> value=0>女</OPTION>
</SELECT></TD></TR>
加到150分Top
7 楼wggipkhgef(不想说乔丹)回复于 2003-09-03 16:54:10 得分 0
<tr>
<td nowrap>特殊推荐</td>
<td ><select name="special">
<option <% if special=false then Response.Write"selected" %> value=false>否</option>
<option <% if special=true then Response.Write"selected" %> value=true>是</option>
/select></td>
</tr>Top
8 楼defore(MiLo.MoonGlow)回复于 2003-09-03 16:54:10 得分 0
不知道你的special变量是什么类型的呢,如果是布尔型 你直接用 special=1或者special=0
(special=true 或者 special=false)判断就可以了
Top




