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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:10:38+00:00 2026-06-11T18:10:38+00:00

I am new to Jquery. I am trying to post a form to a

  • 0

I am new to Jquery. I am trying to post a form to a php file using Jquery Post, I did a var_dump($_POST) in the php file but i can see only an empty array ( saw using firebug net), but i am coming back to the success function of Jquery. May be I am doing some thing silly..All the Javascript behaviour is working as expected except this problem. Somebody please help

$(document).ready(function() {

    //if submit button is clicked
    $('#submit').click(function () {       

        //show the loading sign
        $('#example').modal('show') ; 


        //start the ajax
        $.ajax({
            //this is the php file that processes the data 
            url: "mvc/process_form.php",

            //GET method is used
            type: "POST",


            //Do not cache the page
            cache: false,

            //success
            success: function (html) {             
                //if process_form.php returned 1/true (process success)

                if (html==1) {                 
                    //hide the form
                    $('.form').fadeOut('slow');                

                    //show the success message
                    $('.done').fadeIn('slow');

                //if process.php returned 0/false (send mail failed)
                } else alert('Sorry, unexpected error. Please try again later.');              
            }      
        });

        //cancel the submit button default behaviours
        return false;
    });
}); 
  • 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-11T18:10:39+00:00Added an answer on June 11, 2026 at 6:10 pm

    You need to pass form data as serialize. right now you are not passing form data into your ajax function.

    Here you go:

    $(document).ready(function() {
    
        //if submit button is clicked
        $('#submit').click(function () {       
    
            //show the loading sign
            $('#example').modal('show') ; 
    
    
            //start the ajax
            $.ajax({
                //this is the php file that processes the data 
                url: "mvc/process_form.php",
    
                //GET method is used
                type: "POST",
                data: $("#testform").serialize(),
    
                //Do not cache the page
                cache: false,
    
                //success
                success: function (html) {             
                    //if process_form.php returned 1/true (process success)
    
                    if (html==1) {                 
                        //hide the form
                        $('.form').fadeOut('slow');                
    
                        //show the success message
                        $('.done').fadeIn('slow');
    
                    //if process.php returned 0/false (send mail failed)
                    } else alert('Sorry, unexpected error. Please try again later.');              
                }      
            });
    
            //cancel the submit button default behaviours
            return false;
        });
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to submit a form using JQuery to a PHP page. But
I've been trying to use the new jquery-ui, and all but the resizable function
I'm fairly new to JQuery and I'm trying to add multiple form fields for
I'm very new to jquery and programming in general but I'm still trying to
I'm trying to submit form data with jQuery. I'm using ASP.NET WebMatrix. In a
I'm trying to save contents of a div to new html file. I'm using
so I am new to using jquery .post() however I am not using methods
I'm new to jQuery / AJAX. I'm trying to send single input with jquery/ajax/php.
I'm trying to return a json result from a jQuery Form instance - but
I'm trying to make a really simple file upload using jQuery, without having to

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.