Results 1 to 2 of 2

Thread: cancel key enter

  1. #1
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default cancel key enter

    Hello, I would like to cancel the Enter key from being pressed like the below, but I would like to do it without the inline onkeydown="return CancelEnterHit(event);" and instead use addEventListener.

    Btw, I don't need any cross-browser help. If I can just get this going in FF I should figure the rest out ok(atleast I hope ).

    Code:
    	<script type="text/javascript">
    		function CancelEnterHit(e){
    			if(e.keyCode == 13)
    				return false
    			return true;
    		}
    	</script>
    	<input onkeydown="return CancelEnterHit(event);" id="cancelme" />

  2. #2
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is this a tuff one or did I break a forum rule or something lol? echoooooooo...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •