日期:2014-05-17  浏览次数:21152 次

一个简单的关于取 SELECT 值问题,谢谢!
<select   name= "ecompany ">
    <option   value   =   " <%=rs( "ecompany ")%> "> <%=rs( "ecompany ")%> </option>
</select>
<a   href= "company.asp?ecompany=         "> 查看該公司資料 </a>
我想在不提交FORM的情况下,为上面的超连接参数取得SELECT项的值
或者弹出个新页面该怎么做?



------解决方案--------------------
给select 添加onchange事件,给超链接添加id属性值,当select选择值时,将超链接的href修改成对应ecompany=当前选中的公司名就可
------解决方案--------------------
<script type= "text/JavaScript ">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+ ".location= ' "+selObj.options[selObj.selectedIndex].value+ " ' ");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>


<select name= "ecompany " onchange= "MM_jumpMenu( 'parent ',this,0) ">
<option value = "? <%=rs( "ecompany ")%> " <% if trim(rs( "ecompany "))=trim(request( "ecompany ")) then response.write( "selected ")%> > <%=rs( "ecompany ")%> </option>
</select>
<a href= "company.asp?ecompany= <%=request( "ecompany ")%> "> 查看該公司資料 </a>