选中某一项前做个检查,比如授权,成功后才能真正选中,否则仍然回到刚才未操作的状态

解决方案 »

  1.   

    比如 你确定要选中此项吗 确定后,才真正选中该项
      

  2.   

    参考:
    <span style="border:1px solid buttonface; position:absolute; overflow:hidden">
    <select id="st" style="margin:-2px" onbeforeactivate="getnowid(this.selectedIndex);" onchange="checkct();">
    <option>ct-001<option>ct-002<option>ct-003
    </select></span><script language="javascript">
    var oldid = 0;
    function getnowid(ct){
    oldid = ct;
    }
    function checkct(){//writed by dh20156
    if(confirm('Are you sure?')){
    alert('Do it!');
    document.all.st.blur();
    }else{
    document.all.st.selectedIndex = oldid;
    document.all.st.blur();
    return false;
    }
    }
    </script>