Jump to content

Function Onkeypress for cursor key


newphpcoder

Recommended Posts

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:

<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

Link to comment
https://forums.phpfreaks.com/topic/218094-function-onkeypress-for-cursor-key/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.