Javascript Reference
Categories: tips

javascript move to next input when ENTER key is pressed

@May 11, 2009, 5:25 a.m.
<input onkeydown="if(event.keyCode==13)event.keyCode=9" name="txt1" />
<input onkeydown="if(event.keyCode==13)event.keyCode=9" name="txt2" />

keyCode = 13 is ENTER pressed event
keyCode = 9 is TAB key

Unfortunately, this is IE only. For firefox, it raises the error 'setting a property that has only a getter', beacuase of read-only property of keyCode.
Test:
I loved this post! I read your blog fairly often and you are always coming out with some
great stuff. I will shares this on my facebook, instagram and some of my loyalty followers.
Great jobs! Keep work it with it.
SportsBook - 5Bintang Kasino - 8 hours
I loved this post! I read your blog fairly often and you are always coming out with some great stuff.
I will shares this on my facebook, instagram and some of my loyalty followers.
Great jobs! Keep work it with it.
download rollex11 - 918indo.com - 1 months
I loved this post! I read your blog fairly often and you are
always coming out with some great stuff. I will shares this on my facebook, instagram and some of my loyalty
followers. Great jobs! Keep work it with it.
azteca - 918indo.com - 2 months

Powered by Linode.