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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:49:09+00:00 2026-05-12T14:49:09+00:00

I have a form with some select elements. One of them is configured so

  • 0

I have a form with some select elements. One of them is configured so that if the user changes the value, the next input may get enabled or disabled, depending on the value. When changing the value with the mouse, everything works fine. However, when using the keyboard, strange things happen. It acts differently from one browser to another.

In Firefox, if I change the value to enable the next input, then press the tab key, the focus skips the input that was just enabled. I can focus it by pressing shift+tab, but I think that may be annoying and confusing to users.

In Chrome, if I change the value to enable the next input, then press tab, the focus jumps like in Firefox. If I change the value to disable the next input, then press tab, the next input gets focused despite being disabled. This is strange, but not a big deal because the user can press tab again and focus the input after it.

In Internet Explorer, something very strange happens: everything works fine! If I change the value to enable the next input, then press tab, the next input gets focused. If I change the value to disable the next input, then press tab, the focus skips the disabled input. It works in IE 6, 7, and 8.

I am doing the enabling and disabling with jQuery. I haven’t had a chance to test it with plain Javascript so far.

You can test this issue with the following page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>select focus test</title>
</head>
<body>
<select id="enabler">
    <option value="0" selected>Disabled
    <option value="1">Enabled
</select>
<select id="target" disabled>
    <option value="a">a
    <option value="b">b
</select>
<select id="next">
    <option value="x">x
    <option value="y">y
</select>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$("#enabler").change(function() {
    $enabler = $(this);
    $("#target").attr("disabled", $enabler.val() == "0");
});
</script>
</body></html>

If you change the value of the first dropdown, then press tab, you can see the behavior.

Here is my question: Is there any way to make the form act in all browsers like it does in IE?

  • 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-12T14:49:09+00:00Added an answer on May 12, 2026 at 2:49 pm

    I figured it out. Here is how I did it:

    $("#enabler").bind("change click keydown", function() {
        $enabler = $(this);
        $("#target").attr("disabled", $enabler.val() == "0");
    });
    

    This is Borgar’s idea with a minor modification.

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

Sidebar

Related Questions

i have one form which have some input box and some select box. i
I have next form and some ashx <form action=FileUpload.ashx method=POST enctype=multipart/form-data id=frmUpload> <input id=fileupload
I have one form with several components, some of them have their own validations
Using Drupal 6.20. We can setup some form elements like this:- <input type=select name=somename[]><option>ohai</option></select>
I have some problems sending an id though jquery. I have a form select
I have a form with some input fields. I am using the tabStrip KendoUI
I have a form with some input fields and a little <div> to the
I have a form like this <form id=myform> <input type=hidden name=a value=a1/> <input type=hidden
I have a one main jsp (file upload jsp screen) which has form elements.
I apologize in advance, I am a PHP noob! I have form with some

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.