Results 1 to 2 of 2

Thread: Keydown Left and Right arrow for next page Problem

  1. #1
    Join Date
    Oct 2013

    Keydown Left and Right arrow for next page Problem

    I'm using this code for the left arrow (and a similiar code for right arrow), to go to the next page when pressed. The code works fine, without problems. Except I have a comment section which uses a text area. When typing in the textarea I'd like to turn this javascript off so the user can navigate left and right through the text area. Is their anyway to do this? I was thinking if focus on textarea make the key event do nothing. Would anything like that be possible?

    <script type="text/javascript">
    				if (e.keyCode == 39) { 
    				   //alert( "left pressed" );
    				   return false;
    Thanks in advance

  2. #2
    Join Date
    May 2006
    Somewhere behind your screen
    <!DOCTYPE html>
    <meta charset="utf-8" />
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <textarea id="comments" rows="5" cols="30"></textarea>
    <script type="text/javascript">
    var busy=false;
    alert("right pressed");
    return false;
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles