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 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

OK. So I thought I had this licked ... but now .... I have
I thought I had this figured out but it turns out I'm just deleting
Alright, I thought I had this whole setTimeout thing perfect but I seem to
I thought I had seen a bug report about this on the jQuery site,
This may seem like a programming 101 question and I had thought I knew
can anyone help, i have problem doing a sort, I thought i had it
I thought I had a sql error licked in a post here just a
I thought I had understanding of this in my previous question about linked lists,
Just wondering if you had any thoughts on this problem. I want to make
I had thought I could enumerate the types using IMetaDataImport.EnumTypeDefs and for each of

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.