Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:08:14+00:00 2026-06-12T13:08:14+00:00

<form> <input tabindex=1 required> <input tabindex=2 required> <input> <input tabindex=3 required> <input> <input tabindex=4

  • 0
<form>
    <input tabindex="1" required>
    <input tabindex="2" required>
    <input>
    <input tabindex="3" required>
    <input>
    <input tabindex="4" required>
    <input tabindex="5" required>
    <button type="button" tabindex="6"></button>
    <button type="submit" tabindex="7"></button>
</form>

Here I have a form with some input fields and two button at the end of the form… and I am using tabindex attribute to focus them in order… now on tab key down I need to focus the first input field with tabindex="1" after release focus from the submit button as like as the form focus input field of tabindex="3" after releasing focus from input field of tabindex="2"… How can I do that…??

please don’t use any jQuery… only javascript or html…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:08:16+00:00Added an answer on June 12, 2026 at 1:08 pm

    Finally, I have solved my problem… with HTML and a little javascript it can be done easily… means loop focus of input fields inside a form…

    <form>
        <input tabindex="2" autofocus required>
        <input tabindex="3" required>
        <input>
        <input tabindex="4" required>
        <input>
        <input tabindex="5" required>
        <input tabindex="6" required>
        <button type="button" tabindex="7"></button>
        <button type="submit" tabindex="8" id=""
                onFocus="this.id=this.tabIndex;this.tabIndex=1"
                onBlur="this.tabIndex=this.id">
        </button>
    </form>
    

    Here I skip the tabindex="1" and start with tabindex="2"… then I add 2 more attribute in the submit button… onFocus & onBlur… moreover, I am using the id attribute to memory the primary or real tabindex number of the submit button… when the user will focus on the submit button, javascript will change its tabindex from 8 to 1… now if the user hit the tab button the form will try to find out the element that have the next tabindex… means the first input field… again, when the focus will leave the submit button, javascript will retrieve its real tabindex from its id… means the tabindex will be changed from 1 to 8… in this way the focus will keep looping inside the form…

    Live Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form id=commentform method=post action=wp-comments-post.php> <input type=text aria-required=true tabindex=1 size=22 value= id=author name=author> </form> I
hello i have a problem using z-index. i have a form with some input
I am using an input form with multiple input fields. These input fields can
I have some inputs with OnBlur event handlers something like <input name=abc tabIndex=5 class=datetime
<form action=inc/login/login.php method=post id=userLogon> <div class=field required> Username: <input type=text name=regduser tabindex=1 /><br />
I have a form input in my application that accepts dates in the format
This seems like a must have form input for a mobile ui framework, but
I'm trying to create a custom form input that utilizes some images, it should
I'm trying to clean up form input using the following Perl transliteration: sub ValidateInput
I am trying to clear the value attribute of an 'Other' form input when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.