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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:28:11+00:00 2026-05-12T10:28:11+00:00

I’m using jquery to submit my form (with id #myForm here) as follows: $(document).ready(function()

  • 0

I’m using jquery to submit my form (with id “#myForm” here) as follows:

$(document).ready(function() {  
        $("#my_form").submit(function(event) {  
            $.ajax(  
          {  
              type: "POST",  
              url: $("#my_form").attr("action"),  
              contentType: "application/json; charset=utf-8",  
              data: ("#my_form").serialize(),  
              success: function(result) {  
                  alert('hi');  
              },  
              error: function(req, status, error) {  
                  alert("Sorry! We could not process the form at this time.");  
              }  
          }  
         );  
         event.preventDefault();  
        });//end submit for my_form  
    });//end document ready  

If I view the data being posted, I see the following

POST /PageContents/Edit HTTP/1.1
x-requested-with: XMLHttpRequest
Accept-Language: en-us
Referer: [EDITED OUT BY ME]
Accept: /
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: http://www.somesite.com:3852
Content-Length: 142
Connection: Keep-Alive
Pragma: no-cache

id=1&small_title=Welcome+to!!!&big_title=Chicago!!!&body=here+is+some+stuff+for+the+body.!!!&subheading=The+place+for+pizza!!

But this does not get mapped to the correct action because the Request.Forms collection is empty.

If I submit this form without javascript and just use normal HTML, the data posted looks like this:

POST /PageContents/Edit HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, /
Referer: [EDITED OUT BY ME]
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: http://www.somesite.com:3852
Content-Length: 164
Connection: Keep-Alive
Pragma: no-cache

small_title=Welcome+to%21%21%21&big_title=Chicago%21%21%21&subheading=The+place+for+pizza%21%21&body=here+is+some+stuff+for+the+body.%21%21%21&id=1

You can see, the data being posted properly, so my routing all works and the correct action is called.

All of the fields in my form do indeed have a name attribute.

Thanks, and apologies for the lengthy post.

  • 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-12T10:28:11+00:00Added an answer on May 12, 2026 at 10:28 am

    I think the problem is the contentType you are passing. You have:

    contentType: "application/json; charset=utf-8",
    

    but the data you are passing is not json. Your best bet is to remove that line.

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

Sidebar

Ask A Question

Stats

  • Questions 206k
  • Answers 206k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could try to download the specified plug-in from Eclipse… May 12, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer I figured out what was happening. In my BootStrap I… May 12, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer Menu File → Open → File Select the file to… May 12, 2026 at 9:06 pm

Related Questions

In order to apply a triggered animation to all ToolTip s in my app,
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.