成都兄弟船日本料理店:ASP 下拉菜单为什么取不到值

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 05:09:53
<SCRIPT language=JavaScript type=text/JavaScript>
<!--

function ggothere(){
var thebox=document.footerForm

newwindow=window.open("")
newwindow.location=
thebox.site.options[thebox.site.selectedIndex].value

}

//-->
</SCRIPT>
<FORM name=footerForm>
<SELECT onchange=javascript:ggothere(); name=site size="1">
<OPTION value=0 selected>系统友情链接</OPTION>
<%
set rs2=server.createobject("adodb.recordset")
sql2="select * from link order by id DESC"
rs2.open sql2,conn,3,3
%>
<% do while not rs2.eof%>
<OPTION value=<%=rs2("url")%>><%=rs2("name")%></OPTION>
<% rs2.movenext
loop
rs2.close%>
</SELECT>

同样的代码我在别的页面行..有的页面就不行..不会知道为什么..
我想可能是表单的命名可能重复了..但我查了没有..
各位大侠帮我想想到底是什么问题
这个我是知道的...我不理解的是同样一个程序在别的页面就行...有的页面不行?

thebox.site.options[thebox.site.selectedIndex].value
这一句
thebox应该是from的name
site应该是SELECT 的name

这两个一定要对!

这个很简单!

如果你的<option>的value值也就是你数据库中表"link"中的"url"中的值是外部链接则必须是绝对路径!

例如:
错误的:
<option value="www.baidu.com">
正确的:
<option value="http://www.baidu.com">