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

rekha's Avatar
Contributor
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
0
rekha's Avatar
Contributor
Hi

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



Regards
Rekha
0
rekha's Avatar
Contributor
Hi

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



Regards
Rekha
0
aisha.ansari84's Avatar, Join Date: Feb 2008
Contributor
you are wrong rekha there are experts in this form and they will surely solve your problem
0
rekha's Avatar
Contributor
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
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
HTML Code:
<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" />