当我专注于组合框时,我想显示列表 [英] I want to show list when I focus in combobox

查看:90
本文介绍了当我专注于组合框时,我想显示列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ajax控件工具包comboBox.i想要当我专注于组合框它显示所有的combobox.i列表已经尝试使用javascript但它不工作



我尝试过:



功能开放(){



var myDropDown = document.getElementById('<%= ComboBox1.ClientID%>');



var length = myDropDown.options.length;

alert(hi);

myDropDown.size = length;

}



< cc1:combobox id =ComboBox1runat =serverautocompletemode =SuggestAppendonfocus =Open()>

I have one ajax control toolkit comboBox.i want when I focus on combobox it display all list of combobox.i have tried to do using javascript but its not working

What I have tried:

function Open() {

var myDropDown = document.getElementById('<%=ComboBox1.ClientID%>');

var length = myDropDown.options.length;
alert("hi");
myDropDown.size = length;
}

<cc1:combobox id="ComboBox1" runat="server" autocompletemode="SuggestAppend" onfocus="Open()">

推荐答案

使用javascript:

on mousedown事件的下拉列表(select标签)你可以触发它的Click事件,它将打开下拉列表(select中的选项)。

您可以对onFocus事件执行相同的操作。
Using javascript:
on mouseover event of the dropdown (the select tag) you can trigger its Click event, that will "open" the dropdown list (the options inside the select).
You can do the same for the onFocus event.


这篇关于当我专注于组合框时,我想显示列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆