关于LISTBOX的双击事件

关于LISTBOX的双击事件

首先在LOAD里面,加载: ListBox1.Attributes["onDblClick"] = "shuangjio()"; 注册事件。
 
然后HTML里加入:
 
function   shuangjio()   
  {   
  var   index1;   
  if(document.Form1.ListBox1.length==0)return(false);   
  index1=document.Form1.ListBox1.selectedIndex;   //当前选中项的索引   
  if(index1<0)return(false);   
  var   stxt=document.Form1.ListBox1.options(index1).text;   //该项的text   
  var   sval=document.Form1.ListBox1.value;                     //该项的value 
    document.Form1.shipin.value=sval;
  }
posted @ 2007-11-11 17:16  新房客  阅读(218)  评论(0编辑  收藏  举报