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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:50:30+00:00 2026-06-10T18:50:30+00:00

I have a problem I can’t seem to sort out. I have a form

  • 0

I have a problem I can’t seem to sort out.

I have a form with a custom styled button (input type=button). When typing in the text field, I want people to be able to press the TAB key and go to the button. However, it won’t use a tab-index so my solution was to highlight the label and change the CSS to give the button a new border color. However, the border color will not change on keypress in any browser other than Firefox.

Here is what I have:

$(function() {
    $("#email").bind("keypress", function(e) {
            if (e.keyCode == 13) {
                send();
                return false; 

            };

            if (e.keyCode == 9) {
                    $("#submit_btn").removeClass('submit1').addClass('submit1after');
            };

      });
};

The first enter keypress is to serialize and email the form and all.

I can’t seem to get it to work for the life of me. What am I doing wrong? Is there a better solution to what I’m trying to accomplish?

Thanks for taking the time,

Armik

  • 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-10T18:50:31+00:00Added an answer on June 10, 2026 at 6:50 pm

    Use keydown instead, for me that works (see demo: http://jsfiddle.net/npGtX/2/)

    $(function () {
      $("#email").bind("keydown", function (e) {
        if (e.keyCode == 13) {
          send();
          return false;    
        };
    
        if (e.keyCode == 9) {
          $("#submit_btn").removeClass('submit1').addClass('submit1after');
        };
      });
    };
    

    Also I found this: Suppressing keyPress for non-character keys?

    keypress is not necessarily triggered when the keypress is not a
    character. So the browser may not trigger an event on backspace, F1,
    the down key, etc.

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

Sidebar

Related Questions

I have a problem I can't set the text of a button during a
I have this problem that I can ref a button for control it. I
I have a problem which i can't seem to find the solution to. I
can anyone help, i have problem doing a sort, I thought i had it
Hy, I have a problem and I can't figure it out... declare @start_date datetime,
I have this problem I can't figure out, I query the DB this way:
I have a problem I can not resolve on a form Here's my view:
I seem to have a problem and can't get it work. I'm working on
I have a problem: how can I delete a line from a text file
I have problem I can't figure out but I do have a hint. Before

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.