请教fason等高手:可编辑select的下拉框问题 刚才看了fason以前回的帖子下拉框select编辑的问题已经解决现在还有一个问题就是,哪位高手能不能给欧一段与数据库相关的下拉框的程序??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的编辑框写得并不是很好,下个版本迟点再推出,你要的与数据库相关的程序http://expert.csdn.net/Expert/topic/1965/1965486.xml?temp=.2259027 <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> js 删除table中光标上次所在行 获取标签里面的属性值? Javascript XPath使用过程中的教训 实现表情图片功能!! 怎样用JS获取所有的页面中asp:label 熟悉MooTools的朋友来帮忙看看 网页保存出错 javascript脚本中for有什么用处?? 新手问题--类似于列表框的table 用JS打开“我的电脑” ^_^傻瓜问题:如何用正则限制一个值必须为数值型且在1-60的范围之间 高手们,帮帮忙啦!关于popup window的问题!100分!
http://expert.csdn.net/Expert/topic/1965/1965486.xml?temp=.2259027
<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>