# Setfocus

**URL:** <https://forum.kirupa.com/t/setfocus/25009>\
**Category:** Uncategorized\
**Created:** [July 8, 2003, 2:11pm UTC](https://forum.kirupa.com/t/setfocus/25009 "2003-07-08T14:11:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![batmitra](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@batmitra](https://forum.kirupa.com/u/batmitra)\
**Post date:** [July 8, 2003, 2:11pm UTC](https://forum.kirupa.com/t/setfocus/25009/1 "2003-07-08T14:11:04Z")

</div>

hi everyone

can someone please help me on this?

I want to make a form with several textboxes on it and i want the user to be able to go from one textbox to another pressing the enter key.How can i do this ?

i found a way using a hidden button and unsing the on(keypress “ENTER”) event and the selection.setfocus() function

what i’d like to know is if there is any other way,much easier?

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 6:24pm UTC](https://forum.kirupa.com/t/setfocus/25009/2 "2003-07-08T18:24:07Z")

</div>

I think that’s the easiest and only way. Use a variable, start from 0 and let it get bigger when you press enter, you should then add an onsetfocus: variable = “number”, to set it back.
