1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

How to convert enter key with tab key functionality in onkeyup event

Discussion in 'Web Design, HTML And CSS Forums' started by rekha, Feb 29, 2008.

  1. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I have a form In that form when i press enter key in first field it will go to second field and could not submit the form.How can i do this?



    Regards
    Rekha
     
  2. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    Any answers.......I need quickly.



    Regards
    Rekha
     
  3. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    Nobody knows the solution for this ah.........



    Regards
    Rekha
     
  4. aisha.ansari84

    aisha.ansari84 New Member

    Joined:
    Feb 13, 2008
    Messages:
    82
    Likes Received:
    1
    Trophy Points:
    0
    you are wrong rekha there are experts in this form and they will surely solve your problem
     
  5. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I didn't mean in that way.I want to solve this quickly.If anybody knows the solution for this pls answer me quickly.



    Regards
    Rekha
     
  6. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    HTML:
    <script>
    function handleEnter(e)
    {
    	var characterCode;
    	if(e && e.which)
    	{
    		e = e;
    		characterCode = e.which;
    	} 
    	else 
    	{
    		e = event;
    		characterCode = e.keyCode;
    	}
    
    	if(characterCode == 13)
    	{
    		document.getElementById('nextfield').focus();
    		return false;
    	} 
    	else
    	{
    		return true;
    	}
    }
     </script>
     <input type="text" id="firstfield" onkeypress="return handleEnter(event);" />
     <input type="text" id="nextfield" />
     

Share This Page