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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:04:40+00:00 2026-06-03T06:04:40+00:00

I have a form built in ASP.NET. The first control allows the user to

  • 0

I have a form built in ASP.NET. The first control allows the user to choose a person from an auto-complete list. When the user pressed enter it would refresh the page and duplicate any information acquired through this first control. I am trying to remove the capability of the enter key from refreshing the page. This code all works in Chrome and IE7/8/9 (Don’t care about 6). All I NEED is the return false for it to work in all browsers we support besides Firefox. The .click() is a bonus to add a bit of usability back to the key (so that it will activate the controls and check or uncheck check boxes, etc.)

None of this works in Firefox 12. The click occurs (proof that the code is reached when I want it) but the page refreshes every single time.

The focusNextInputfield() was one of the suggestions from a similar question and didn’t do anything I wanted. It may have done what it was intended for but I can’t tell because the page refreshed.

I found preventDefault() and stopPropagation() from yet another similar question on my own and it did nothing in FF.

I have even tried returning true for the heck of it.

   $(document).keydown(function (event) {
   //handles what happens when the user hits enter
       if (document.activeElement.nodeName !== 'TEXTAREA') {
           if (event.keyCode === 13 || event.which === 13) {
                $(document.activeElement).click();
               // $(document.activeElement).focusNextInputField();
                event.preventDefault();
                event.stopPropagation();
                return false;
           }
       }
    }); 

I am just looking for any suggestions or news on any reason none of this has any effect in FireFox 12? And I know that the code is reached and it all runs properly without error and even with all the excess code it still runs properly in Chrome and IE 7/8/9 as I said.

And through an earlier iteration I tried forcing the submit button to be clicked but it still refreshed anyway and validated and was overall a bad user experience.

  • 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-03T06:04:41+00:00Added an answer on June 3, 2026 at 6:04 am

    Looks like you are using jQuery so all you need is to preventDefault in form submit event.

    $j("#form-id").submit(function(e) {
        e.preventDefault();
        ...
    });
    

    Or:

    $j("#form-id").submit(false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom control that mimics to some extent the built in ASP.Net
I have a standard data-entry type form built in ASP.NET. I am pretty green
I have a for which is built within an ASP.net usercontrol. This form is
I'm trying to have the action of a HTML form built when the user
I have an ASP.Net form and I want to send an email when the
Its my first time with asp.net MVC 2. Im came from asp.net webforms. I
I have a site which is built in ASP.net and C#. Let's call it
I am trying to use a web service built on asp.net wcf from iPhone
I have a classic asp application. I want to post a contest form from
I have an ASP.NET application that makes use of the built in validation controls.

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.