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

  • Home
  • SEARCH
  • 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 6683779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:51:40+00:00 2026-05-26T04:51:40+00:00

OK, so I thought I had this licked by I was wrong. Basically, I

  • 0

OK, so I thought I had this licked by I was wrong.

Basically, I have a form wrapped in a span (#container) and embedded in a page. The server side does all the validation and detects whether it’s a full HTTP request or XHR.

If it’s a full HTTP request, the server returns a full page, complete with layout. If it’s an XHR request, the server returns only the form element and its children. The form may or may not include errors.

So, I’m looking for the easiest way to ajaxify this form using jQuery. Basically, I think I need to do something like this:

  • When the document is ready, bind a function to the click event of the submit button using jQuery’s .live() method. (This is easy enough).

The function needs to do something like this:

  • Trigger the submit event on the form
  • Capture the html response
  • Replace the contents of #container with the response contents

Does this sound about right? Any asssitance is appreciated!

  • 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-26T04:51:41+00:00Added an answer on May 26, 2026 at 4:51 am

    If you trigger the submit event on the form, it will submit as a full http request unless you add onsubmit = "return false;” to your form tag. The easiest way would be to use $.post() in combination with a $.serialize() where you can also capture the servers response. It might look something like this.

    $.post(
        'myFormURL.php',
        $('#idOfMyForm').serialize(),
        function(results) {
            $('#container').html(results);
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is related to another question that I posted on SO earlier How
Let's say you have a complex resource in a REST API. You have several
I've been working on this for days and I can't find a proper solution,
From here I have created a BaseForm , then set all its BaseForm.Designer.cs private
Does anyone have any good examples of how to make Unity 1.2 or 2.0
Some years ago I dipped my foot in the water of developing WML websites
Recently, I've been experimenting with caching objects with HttpRuntime.Cache and I was generally under
My question is about throw and exception bubbling. I was searching around about file
I am working with a microcontroller that has an external EEPROM containing tables of
I've a bit of an odd issue with FCKEditor in my MVC project. I've

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.