刚才看了fason以前回的帖子
下拉框select编辑的问题已经解决
现在还有一个问题就是,哪位高手能不能给欧一段与数据库相关的下拉框的程序???

解决方案 »

  1.   

    我的编辑框写得并不是很好,下个版本迟点再推出,你要的与数据库相关的程序
    http://expert.csdn.net/Expert/topic/1965/1965486.xml?temp=.2259027
      

  2.   

    <body onload="s1.focus();">
     <script language="JavaScript">
    <!--
    function catch_keydown(sel)
    {
    switch(event.keyCode)
    {
    case 13:
    //Enter;
    sel.options[sel.length] = new Option("","",false,true);
    event.returnValue = false;
    break;
    case 27:
    //Esc;
    alert("text:" + sel.options[sel.selectedIndex].text + ", value:" + sel.options[sel.selectedIndex].value + ";");
    event.returnValue = false;
    break;
    case 46:
    //Delete;
    if(confirm("删除当前内容?"))
    {
    sel.options[sel.selectedIndex] = null;
    if(sel.length>0)
    {
    sel.options[0].selected = true;
    }
    }
    event.returnValue = false;
    break;
    case 8:
    //Back Space;
    var s = sel.options[sel.selectedIndex].text;
    sel.options[sel.selectedIndex].text = s.substr(0,s.length-1);
    event.returnValue = false;
    break;
    }
    }function catch_press(sel)
    {
    sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex].text + String.fromCharCode(event.keyCode);
    event.returnValue = false;
    }
    //-->
    </script>
    <select name=s1 onkeydown="catch_keydown(this);" onkeypress="catch_press(this);" style="font-size:12px;"><option>---</option></select>
    <BR>可以编译的下拉框
    </body>