Sign in to follow this  
indigo

Tab browsing between Edit Boxes

Recommended Posts

Hi,

Is there a way to jump between edit boxes / buttons on a page by pressing i.e. the tab key? I've tried via speed key and to look online but I could never find anything.

Thanks in advance for your support!

Share this post


Link to post
Share on other sites

Yes, but it is not as easy as I would hope.  You need to create a sequence called OnKeyDown and then add some script.  For example, if you had a user/password popup:

if (component.userNameEdit.GetFocus())
   if (key == 9)
      component.userPasswordEdit.SetFocus()
      return
   endif
   if (key == 13)
      enteredName = component.userNameEdit.strContents
      enteredPass = component.UserPasswordEdit.strContents
      Login(EnteredName,EnteredPass)
   endif      
endif
if (component.userPasswordEdit.GetFocus())
   if (key == 9)
      component.UserNameEdit.SetFocus()
      return
   endif
   if (key == 13)
      enteredName = component.userNameEdit.strContents
      enteredPass = component.UserPasswordEdit.strContents
      Login(EnteredName,EnteredPass)
   endif      
endif

Login() is just some function that performs the login.  The key parts are the GetFocus() which returns if the specified component is focused, SetFocus() which sets a component to have focus, and the checks for "key" which is a parameter passed to OnKeyDown with the key code of the key pressed.  9 is tab, 13 is carriage return.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this