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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:03:01+00:00 2026-05-24T13:03:01+00:00

I had a simple script that when you pressed C you’d be redirected to

  • 0

I had a simple script that when you pressed C you’d be redirected to a different page, same for other letters.
However, every time you would press the button this would happen, even if you were typing text into an input text field.

Can anyone write a lightweight script to allow me to make multiple hotkeys without them working in input fields or can show me where I can find documented explanations for this?


Okay, so I have the hotkey working, just can’t make it stop.

$("input.registerform").keypress(function(e){

   e.stopPropagation();
});

Here is what I have to make it stop, the class of my input form is registerform bgcolor2 but it won’t work with input.registerform, nor with input.registerform bgcolor2.

I tried adding an ID to it with registerform as ID; didn’t work either :/

Is it being caused by my AJAX? or am I missing something here?

  • 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-24T13:03:02+00:00Added an answer on May 24, 2026 at 1:03 pm

    Try this

        $(document).keypress(function(e){
    
           if(e.which == 13){
          //Enter key is press do what you want
       }
       else if(e.which == 67 || e.which == 99){
          //C key is press do what you want
    
          //window.location.href = "urlToRedirect";
           alert("C pressed");
       }
        else if(e.which == 32){
            alert("Space pressed");
    
        }
           //Similarly check for as many conditions you want for different keys(ascii code)
    
        });
    
        //To supress this behavior do not happen in input field stop the event propagation
    
        $("input").keypress(function(e){
           //code goes here
           e.stopPropagation();
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had to make a really small and simple script that would fill a
Edit: Originally I had a simple form Ajax script that wasn't working, turns out
I created a simple test page on my website www.xaisoft.com and it had no
How can I write a simple Greasemonkey script that allows it to search for
recently I had to write a little script that parsed VMs in XenServer and
The day came when I had to write a BASH script that walks arbitrary
I have a simple PHP script with a form that has two select fields,
I just had some very strange behavior with a simple php script I was
I need a complete WiX script that can be build.It had Welcome EULA Install
I have written a simple script that calls a function in a while loop.

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.