救命啊~~~~SELECT 问题~~大家都来看看~~`555~~ 加个selected<OPTION value="1" selected>sdff</OPTION> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不对吧?那当我单击上下尖头选择时,显示在当前SELECT框里的值能被自动选中吗? 我的意思是,我列出了1960直2005的数值。<select name="year_mm" size="1" multiple id=select3> <% for i=1960 to 2005 response.Write "<option value="&i&">"&i&"</option>" next %> </select>SIZE=1,所以SELECT框一次只会显示一条数据,在SELECT框右边会出现一个上下前头进行选择。就是如果,当被选择后的数据显示在SELECT框里,然后自动被选中。不用在单击它。大家试一下,帮帮我,,,急~~~~~~~ <select name="year_mm" size="1" multiple id=select3 onclick="setSelected(true)"> <% for i=1960 to 2005 response.Write "<option value="&i&">"&i&"</option>" next %></select><script>function setSelected(w) {var getyear_mm=document.all.year_mm.options;for(i=0;i<getyear_mm.length;i++)getyear_mm(i).selected=w;}</script>点击就能把所有的option选中. to wanghr100(灰豆宝宝.net)谢谢你的帮助。但是你那样做,就把所有值全都选择完了。我只要自动选择显示在当前SELECT框里的值。仅仅一个值。该怎么样做呢? Sorry..模拟一下.<select name="year_mm" size="1" multiple id=select3 onselect="alert('selecting')"> <% for i=1960 to 2005 response.Write "<option value="&i&">"&i&"</option>" next %></select><input type=button name="submit" value="<" onmousedown="timer1=setInterval('selectProv()',100)"onmouseup="clearInterval(timer1)"><input type=button name="submit" value=">" onmousedown="timer2=setInterval('selectNext()',100)"onmouseup="clearInterval(timer2)"><script>function selectNext() {n=document.all.year_mm.options.length;i=document.all.year_mm.selectedIndex;i++;if(i<n) document.all.year_mm.selectedIndex=i;}function selectProv() {n=document.all.year_mm.options.length;i=document.all.year_mm.selectedIndex;i--;if(i>=0) document.all.year_mm.selectedIndex=i;}</script> 今天加班,真让我忙晕了,把JAVASCRIPT脚本都忘了怎么写了...打脸打脸,以后努力学习...哎....最后由衷的谢谢你wanghr100(灰豆宝宝.net) 让我今天加班感觉很温暖...~~ 页面上点击图片链接会弹出另一个页面悬浮在当前页上面 之后点击关闭后可以返回当前页面 Js中如何得到单选按钮和下拉列表的值 html的一些快捷键 很奇怪的 JavaScript 语法 jquery 插件怎么回事? scrollTop具体指哪个距离? 哪位大哥有javascript写asp的教程或实例~~~~~~~~~~~~ 如何判断一个对象是否存在? 用绘图指令我为什么不能输出文本? 这样的正则如何写 怎样制作例如 http://www.tunnel.net.cn/oa.gif左边的导航菜单 散分1000,分太多郁闷ing
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>SIZE=1,所以SELECT框一次只会显示一条数据,在SELECT框右边会出现一个上下前头进行选择。就是如果,当被选择后的数据显示在SELECT框里,然后自动被选中。不用在单击它。大家试一下,帮帮我,,,急~~~~~~~
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>
<script>
function setSelected(w) {
var getyear_mm=document.all.year_mm.options;
for(i=0;i<getyear_mm.length;i++)
getyear_mm(i).selected=w;
}
</script>点击就能把所有的option选中.
但是你那样做,就把所有值全都选择完了。我只要自动选择显示在当前SELECT框里的值。仅仅一个值。该怎么样做呢?
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>
<input type=button name="submit" value="<"
onmousedown="timer1=setInterval('selectProv()',100)"
onmouseup="clearInterval(timer1)">
<input type=button name="submit" value=">"
onmousedown="timer2=setInterval('selectNext()',100)"
onmouseup="clearInterval(timer2)">
<script>
function selectNext() {
n=document.all.year_mm.options.length;
i=document.all.year_mm.selectedIndex;
i++;
if(i<n) document.all.year_mm.selectedIndex=i;
}function selectProv() {
n=document.all.year_mm.options.length;
i=document.all.year_mm.selectedIndex;
i--;
if(i>=0) document.all.year_mm.selectedIndex=i;
}
</script>
让我今天加班感觉很温暖...
~~