<script language="javascript">
function aa() {
i=document.frmtest.seltest.length;
}
function pp(){
document.frmtest.seltest.options[i]=new option(ok=(document.frmtest.seltest.options[i])?document.frmtest.seltest.options[i].innertext+string.fromcharcode(event.keycode):string.fromcharcode(event.keycode),ok)
document.frmtest.seltest.selectedindex=i;
}
function edit(){
if(document.frmtest.seltest.options[i]){
if(event.keycode==8){
var str=document.frmtest.seltest.options[i].innertext;
var len=str.length;
document.frmtest.seltest.options[i].innertext=str.substring(0,len-1);
if(document.frmtest.seltest.options[i].innertext=="")
document.frmtest.seltest.remove(i);
}
if(event.keycode==13)return false;
if(event.keycode==32){
document.frmtest.seltest.options[i].innertext+=" ";
}
}
}
</script>
<body onload=aa();>
得到的数据:<%=request.form("seltest")%>
<form name=frmtest action=test.asp method="post">
<select onkeypress=pp() onkeyup="edit()" name="seltest">
<option>测试程序</option>
<option>nanaka</option>
<option>zergman</option>
</select>
<input type=submit>
</form>
</body>
可以输入的下拉框,我重新写了一下
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 可以输入的下拉框,我重新写了一下
相关推荐
- 暂无文章
