在NN6里,当你按下 Delete 键时,会触发 onkeydown, onkeypress, 和 onkeyup 事件,可以用 event.which == 46 来进行捕捉。  但在IE5里,当按下 Delete 键时,只触发 onkeydown 和 onkeyup 事件,而不会触发 onkeypress 事件,可以通过 event.keyCode == 46 来进行捕捉。  但在NN4里,只触发 onkeyup 事件,而且 event.which 的返回值是0,因此,我们没有办法捕捉 Delete 按键的动作了!!

解决方案 »

  1.   

    列表框没有onkeyup,onkeydown事件吧
      

  2.   

    shiftKey Property
    Retrieves the state of the SHIFT key. [ bKey = ] event.shiftKey 
    Possible Values
    bKey Boolean that specifies one of the following values: 
    false SHIFT key is not pressed. 
    true SHIFT key is pressed. The property is read-only with no default value. ----------------------ctrlKey Property:
    Retrieves the state of the CTRL key. [ bEvent = ] event.ctrlKey 
    Possible Values
    bEvent Boolean that specifies one of the following values: 
    false CTRL key is not pressed. 
    true CTRL key is pressed. 
     
    The property is read-only with no default value. 
      

  3.   

    <form>
    <input name=aaa >
    <input type=button value="点击提交,但是按住Ctrl并点击就不提交" onclick="if(!event.ctrlKey) this.form.submit();">
    </form>
      

  4.   

    toJK_10000(JK) :有例子吗,我还不知道怎么用
      

  5.   

    <form name="form1">
    <select multiple size="5" onclick="bao()">
    <option value="1">item1
    <option value="2">item2
    <option value="3">item3
    <option value="4">item4
    <option value="5">item5
    </select>
    <input type="submit" value="提交">
    </form>
    <script>
    function bao()
    {
        if(!event.ctrlKey && !event.shiftKey)
        {
            form1.submit();
        }
    }
    </script>