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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:29:22+00:00 2026-05-30T17:29:22+00:00

I am seeing a weird behavior when I POST using AJAX. When I have

  • 0

I am seeing a weird behavior when I POST using AJAX. When I have the following code,

    <a id="submit" class= "btn btn-large btn-primary">Sign Up</a> (form submit)
$('#submit').on('click', function(){
console.log($('#biz_details').serialize());
    $('#status').css('display','block');
    $.post('/business/signup',$('#biz_details').serialize(), function(data){
        $('#updated').text('Success.').append('<a href="/business/profile">     here to view profile </a>');
}
 ,'json');
});

things seem to work fine. However, when I use

    <submit id="submit" class= "btn btn-large btn-primary">Sign Up</submit> (form submit)

instead of the <a> tag, I get error: [Errno 32] Broken pipe. Also, I am redirected to
the same URL (\business\signup) but with my POST parameters being sent as GET.
To illustrate, if I were POSTing a=1&b=2, I am redirected to \business\signup?a=1&b=2.
My form declaration is

    <form class="holder form-horizontal" id="biz_details"  style= "background-color: white;overflow-y:hidden;">

Further, if I do have an action attribute to my form and have a js call in the action to the POST function, it works fine.
Can anyone throw some light on this behavior, especially the one about redirects?

  • 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-30T17:29:23+00:00Added an answer on May 30, 2026 at 5:29 pm

    In order for the function to work correctly with the submit button, you have to disable the default action for the form, and since you haven’t defined a METHOD, the default (GET) is used.

    To disable the default action, simply add a return false at the end of the function that is trigged on the form submit.

    $('#myform').submit(function() {
       // do something
       return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm seeing some weird behaviour debugging my C# code - I cant post my
The following program shows the weird double to int conversion behavior I'm seeing in
I am seeing some weird behavior (or I am missing something) with the following
I am seeing some rather weird behavior with PowerShell, it looks like custom functions
I'm seeing some weird behavior in php when comparing a double to a string
I'm seeing a really weird issue with this code and sample execution: https://gist.github.com/720278 The
I'm seeing a weird error in one of my ajax-updated pages. The request looks
I am seeing some very weird behavior with a set of ListViews that I
This is a confusing behavior that I'm seeing in FireFox and Chrome: I have
All, I am seeing some really weird behavior when I run a query in

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.