Results 1 to 4 of 4

Thread: Tab press should stay in the same form

  1. #1
    Sencha User
    Join Date
    Apr 2014
    Posts
    19
    Answers
    2

    Default Answered: Tab press should stay in the same form

    Hi,

    I have a form with controls. On pressing tab key, focus on controls change, focus will also shift to browser url address bar. I want tab press should focus only in the form itself.

    Please help me.

    Thanks & regards
    Rakesh

  2. Hi,

    I got the solution. I gave the tabIndex from 1 (for first element) to 'n' (for 'n'th element). In the 'n'th element using 'blur' event focus to first element.

    Thanks & regards
    Rakesh

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    You'd need to capture the tab key press on the last field, stop the event and then focus the first field. You'd also need to do the same on the first field so you could shift + tab back to the last.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User
    Join Date
    Apr 2014
    Posts
    19
    Answers
    2

    Default

    Hi evant,

    Thanks for the reply. If the last field is button how can i capture tab key press. Button does not have key press event.

    Thanks & regards
    Rakesh

  5. #4
    Sencha User
    Join Date
    Apr 2014
    Posts
    19
    Answers
    2

    Default

    Hi,

    I got the solution. I gave the tabIndex from 1 (for first element) to 'n' (for 'n'th element). In the 'n'th element using 'blur' event focus to first element.

    Thanks & regards
    Rakesh

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •