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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:43:40+00:00 2026-05-24T23:43:40+00:00

So I have done this a few times and it has worked, but for

  • 0

So I have done this a few times and it has worked, but for some reason my form won’t work this time. When I submit the form jQuery uses mail.php to do one final validation. It then either submits it or echoes the form back with errors.

So basically when I submit the form with errors, it will echo it back with the respective errors, but when I correct the values and try to resubmit, it won’t resubmit.

Here’s the code:

<html>
<head>
    <title>Contact Form Example</title>
    <script type="text/javascript" src="js/jquery.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {

            $('#email').keypress(function() {
                p = {};
                p['email'] = document.getElementById("email").value;
                $("#emailcheck").load("validate_email.php", p);
            });

            $('#message').keypress(function() {
                p = {};
                p['message'] = document.getElementById("message").value;
                $("#messagecheck").load("validate_message.php", p);
            });

                $('#mail').click(function() {

                    p = {};
                    p['email'] = document.getElementById("email").value;
                    p['message'] = document.getElementById("message").value;
                    $("#body").load("mail.php", p);

                });

        });
    </script>

</head>
<body>

    <table style="display: block;" id="body">
        <form action="mail.php" method="POST">
        <tr>
            <td align="right">
                <label for="email">Email:</label>
            </td>
            <td align="left">
                <input type="text" name="email" id="email" />
            </td>
            <td id="emailcheck"></td>
        </tr>
        <tr>
            <td align="right" valign="top">
                <label for="message">Message:</label>
            </td>
            <td align="left">
                <textarea rows="5" cols="30" name="message" id="message"></textarea>
            </td>
            <td id="messagecheck"></td>
        </tr>
        <tr>
            <td></td><td><input id="mail" type="submit" value="Email" onclick="return false;"/></td>
        </tr>
        </form>
    </table>

</body>

  • 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-24T23:43:41+00:00Added an answer on May 24, 2026 at 11:43 pm

    Right here:

    $("#body").load("mail.php", p);
    

    You’re replacing the entire content for #body. That includes all the elements that you’ve bound callbacks to so all those callbacks are lost. That probably leaves with just onclick="return false;" as the action for #mail so your form is dead.

    You can bind your callbacks with live or delegate or rebind all your handlers when you replace #body.

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

Sidebar

Related Questions

It's the first time I have done anything like this but wondered what the
i have done some code in jquery but where i commented in this bellow
I know this question has been asked quite a few times, however, I have
I know this questions has been asked a few times here. But these seem
I have done this operation millions of times, just using the + operator! I
I have done this without much effort on T-SQL, but I want to implement
I have done this before but I forgot where in my app I have
i have done something like this: <form action=validate.php method=get> Id :<input type=text name=pID/><br/><br/> Name
I have done some looking and I found this: http://www.codeproject.com/Articles/14439/The-ScrollableListBox-Custom-Control-for-ASP-NET-2 but to me it
I appreciate this is a question that has been asked a few times, I

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.