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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:25:59+00:00 2026-06-11T21:25:59+00:00

I am using ajax to post a form to my localproxy which then posts

  • 0

I am using ajax to post a form to my localproxy which then posts to affiliate client and also my database. However it keeps either not posting using ajax or coming up with an error. I used this exact code format on other sites without a problem.

my ajax code

$(document).ready(function(){

     // ajax code start
    $('#form').on('submit', function (e){
    e.preventDefault();
    $.ajax({
    type: "POST",
    url: "/localProxy.php",
    data: $('#form').serialize(),
    success: function (response) {
            document.location = '/thank-you';
             // do something!
    },
    error: function () {
            alert('There was a problem!');  // handle error
    }
        });
        });

And here is my current form header and submit code

<form id="form" name="form" >

<input type="submit" name="submit" id="submit" value="Enter" />

Either the default submit activates bypassing the ajax or the alert message comes up.

  • 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-11T21:26:00+00:00Added an answer on June 11, 2026 at 9:26 pm

    Make sure you have no error in your localProxy script or it does exist. I also noticed you have a missing function enclosure in your code:

    $(document).ready(function(){
         // ajax code start
        $('#form').on('submit', function (e){
            e.preventDefault();
            $.ajax({
                type: "POST",
                url: "/localProxy.php",
                data: $('#form').serialize(),
                success: function (response) {
                        document.location = '/thank-you';
                         // do something!
                },
                error: function () {
                        alert('There was a problem!');  // handle error
                }
            });
        }); // <--- I just added this and it's submitting properly
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My site has a form which insert records in a database using ajax, at
I have made a form validation using ajax post method. But i got the
When a form with a textarea using CkEditor is submitted using ajax the post
I'm submitting a form using an ajax request (POST method), and checking the HTTP
I'm stumped. I'm using jquery and ajax to POST some fields from a form
I am successfully posting a form via ajax, using the following code; $.post( Page.do?source=ajax,
I would like to post a form using ajax and jquery to a .asmx
I am using an AJAX form post to send some form fields to the
I am using an Ajax request to post a form with Jquery. $.ajax( {
I am using ajax post method to post the form like :- $(function ()

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.