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 793921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:13:59+00:00 2026-05-14T22:13:59+00:00

I used a javascript FocusChange() in my aspx page. I have couple of controls

  • 0

I used a javascript FocusChange() in my aspx page. I have couple of controls and I need Hit enter key need to move next control based on tab index. It is working good in IE7 but not working in IE8… Please help me on this..

Thanks for your help in advance. The java script is given below.

function FocusChange() {
    if (window.event.keyCode == 13) {

         var formLength = document.form1.length; // Get number of elements in the form
         var src = window.event.srcElement; // Gets the field having focus
         var currentTabIndex = src.getAttribute('tabindex'); // Gets its tabindex

        // scroll through all form elements and set focus in field having next tabindex
         for (var i = 0; i < formLength; i++) {
           if (document.form1.elements[i].getAttribute('tabindex') == currentTabIndex + 1) {
             for (var j = i; j <= formLength; j++) {
                 if (document.form1.elements[j].disabled == false) {
                      document.form1.elements[j].focus();
                      event.returnValue = false;
                      event.cancel = true;
                      return;
                        }
                    }
                }
            }
        }
    }
  • 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-05-14T22:14:00+00:00Added an answer on May 14, 2026 at 10:14 pm

    I’ve got the same request as you, but solved it in a different manner, just replacing the Enter for Tab

        <script language="JavaScript">
        document.onkeydown = myOnkeydown;  
        function myOnkeydown()
        {        
            var key = window.event.keyCode;
            if (key == 13)  //13 is the keycode of the 'Enter' key
                {window.event.keyCode = 9; //9 is the code for the 'Tab' key. Essentially replacing the Enter with the Tab.
            }
        }
        </script>
    

    Warning: Works in IE only.

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

Sidebar

Related Questions

I have used Javascript onlaod like this: function check() { var pic = new
I have an old web app where Javascript is used to validate some dates.
I have a input box with the attribute overflow:hidden; I have also used javascript
I have not really used JavaScript before but I am trying to validate form
I have a repeater showing the rows of data.I have used javascript for user
I have a template that has some Javascript used to generate graphs in the
Recently i completed on mid level web application where i have used telerik controls,
I never used javascript, but I need it for my project. I would like
I have a SharePoint Date Picker Control which is used to select a BirthDate
I have a used a javascript replace to wrap all words seperated by a

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.