Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   Function Onkeypress for cursor key (http://www.go4expert.com/forums/function-onkeypress-cursor-key-t23792/)

newphpcoder 8Nov2010 14:23

Function Onkeypress for cursor key
 
Good day!
In my javascript code I have a function for the enter key. I want to add cursor key in that function/ I research about the coding for cursor key but I can't find the code same on what I want to happen.
Here is the code:
Code:

<script language="javascript">
  function handleEnter(e, nextfield)
        {
        var characterCode = (e && e.which)? e.which: e.keyCode;
        if(characterCode == 13)
            {
            document.getElementById(nextfield).focus();
            return false;
            }
        else
            {
            return true;
            }
        }
    </script>
<input type='text' name='plt' onkeypress='return handleEnter(event,\"b0\");' />

Thank you


All times are GMT +5.5. The time now is 14:46.