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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:18:34+00:00 2026-06-10T23:18:34+00:00

Clicking a link in my page submits an ajax request and loads the response

  • 0

Clicking a link in my page submits an ajax request and loads the response in a modal dialog window. That response contains a form with id ‘ModalForm’. What I am trying to achieve is to prevent the default form behavior of the ‘Enter’ key for this specific form and replace it with execution of a JS function that I wrote. Unfortunately I can’t get it to work nor I receive an alert message. Here’s my code:

jQuery(function (){
    jQuery('#ModalForm').keypress(function(e){
        alert(e.keyCode);
        if (e.keyCode == 13) {
            modalWindowSubmit();
        }
    });

    jQuery('#ModalForm').on('keypress', (function() {
        alert('hi');
    });

});

Thanks in advance!

  • 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-10T23:18:35+00:00Added an answer on June 10, 2026 at 11:18 pm

    You have to bind the event on the form in the “success” of the ajax call

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

Sidebar

Related Questions

In a page I have a link; clicking on it opens a dialog and
I have an application that opens a new window on clicking a link. This
I have a page in which i have provided a link clicking on which
I have a user control with a More Info link. When clicking that link,
I want to fake a page submit (post) on clicking a link. I need
I have a textbox on my page that ppl can input numbers, by clicking
I made confirmation window showing by clicking a button on my page. For Russian
Net MVC 3.0 Project I have a form in my page and a Ajax.ActionLink
I'm playing around with jquery and made a form that submits information without a
I want to load a modal dialog box by clicking submit tag. but when

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.