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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:03:15+00:00 2026-06-11T06:03:15+00:00

I have a form that I am trying to submit with POST. When I

  • 0

I have a form that I am trying to submit with POST. When I go to catch the POST vars, nothing is being sent.

<?php require_once("../includes/initialize.php"); ?>
<html><head>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script src="jquery-1.8.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('form').submit(function (e) {
        var $this = $(this);
        e.preventDefault(); // This prevents the form submission.

        $("#messageSent").show("slow");
        $this.closest('#contactForm').slideUp('slow', function () {
           $this[0].submit(); // Actual submission.
        });                
    });

    $("#contactLink").click(function(){
        if ($("#contactForm").is(":hidden")){
            $("#contactForm").slideDown("slow");
        }else{
            $("#contactForm").slideUp("slow");
        }
    });

});
</script></head><body>
<?php 
if(isset($_POST['signupSubmit'])){
echo "Post is set";
echo $_POST['name'], "<br />";
echo $_POST['email'];
}else{
echo "post is not set";
}
if(isset($_POST['signupSubmit'])){
    $signup = new Signup();
    $signup->name = $_POST['name'];
    $signup->email = $_POST['email'];
    if($signup->save()) {
        $session->message("We will contact you with details.");
    } else {
        $session->message("Failed", $signup->errors);
    }
}
echo output_message($message);
?>
    <div id="contactFormContainer">
        <div id="contactLink"></div>
        <div id="contactForm">
            <form action="test2.php" enctype="multipart/form-data" method="post">
            <fieldset>
                <label for="name">Name *</label>
                <input id="name" type="text" name="name" />
                <label for="email">Email address *</label>
                <input id="email" type="text" name="email" />
                <input id="sendMail" type="submit" name="signupSubmit" />
                <span id="messageSent"></span>
            </fieldset>
            </form>
        </div>
    </div>

</body>
</html>

Any help would be 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-06-11T06:03:16+00:00Added an answer on June 11, 2026 at 6:03 am

    That’s because when you submit the form with $this[0].submit(); it still runs the submit handler which unconditionally prevents the form from submitting. Set some flag so the form will submit after the animation.

    $('form').submit(function (e) {
        var $this = $(this);
        if (!$this.data('afteranimation')){
            $("#messageSent").show("slow");
            $this.closest('#contactForm').slideUp('slow', function () {
                $this.data('afteranimation', true);
                $this.submit(); // Actual submission.
            });                
            e.preventDefault(); // This prevents the form submission.
        }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that i am trying to submit after the page loads
I have a PHP form that needs some very simple validation on submit. I'd
I have a log in form that I am trying to submit via AJAX.
I have a textarea in a form that im trying to POST into a
I have a php / ajax / javascript form that I am trying to
What I'm trying to do is: I have a form. I submit that form.
I have a pretty simple form that I'm trying to post back synchronously to
I have a form that is trying to insert some data into an SQL
Please have a look at this form that I am trying to design with
I'm have a fair complex Form that I am trying to create in Play

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.