日期:2014-05-16  浏览次数:20342 次

select有text的功能
select要有text的功能,也就是也可以输入,同时具有输入的同时,select会自动展开符合你输入内容的option.
    给分100,请高手指教.

    如: <option   value= "PEK "> Beijing   北京 </option>          
        <option   value= "SHA "> Shanghai   上海 </option>
    当输入S时,Shanghai   上海     就会被选中,并展开,Shanghai   上海   为第一个.

------解决方案--------------------
<option value= "PEK " accesskey= "b "> Beijing 北京 </option>
<option value= "SHA " accesskey= "s "> Shanghai 上海 </option>

------解决方案--------------------
哦,接楼上,在适当的时候(比如已经选择)再次隐藏select
------解决方案--------------------
http://webfx.eae.net/dhtml/combobox/combobox.htm
------解决方案--------------------
难道是这样?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
<script>
function show()
{
//var d = document.getElementById( "3 ");
//alert(d.value);
var a = document.getElementById( "1 ").value;
if(a.length> =1)
{
if(a.toLowerCase()== "s "||a.toLowerCase()== "sha "||a== "上海 "||a.toLowerCase()== "shanghai ")
{
var select = document.getElementById( "2 ");
for(var i=0;i <select.length;i++)
{
if(select.options.item(i).value== "SHA ")
{
select.options.item(i).selected= "true ";
}
}
}
if(a.toLowerCase()== "p "||a.toLowerCase()== "pek "||a.toLowerCase()== "北京 "||a.toLowerCase()== "beijing ")
{
var select = document.getElementById( "2 ");
for(var i=0;i <select.length;i++)
{
if(select.options.item(i).value== "PEK ")
{
select.options.item(i).selected= "true ";
}
}
}
}

}
setInterval( "show(); ",50);
</script>

</HEAD>

<BODY >
<input type= "text " id= "1 "> </input>
<select id= "2 ">
<option> </option>
<option value= "PEK "> Beijing 北京 </option>
<option id= "3 " value= "SHA "> Shanghai 上海 </option>
</select>
</BODY>
</HTML>

------解决方案--------------------
这个只能模拟

http://www.scbr.com/docs/company.shtml
这里面左里的有,你找找
------解决方案--------------------
那就是自定义控件喽,用一个input一个select来模拟。用input的onkeyup来控制,你要的那种效果。
------解决方案--------------------
给点分吧 。。 555555555555555555555
=============================================

<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">