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

The Archive Base Latest Questions

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

I have tried so many things, cannot figure this out, I am using this

  • 0

I have tried so many things, cannot figure this out, I am using this code, and I know that the start is working, because the script it connects to sticks some info in the db, but the callback never runs.

<script type="text/javascript">
$(document).ready(function() {
    $(document.body).on('click', "#reply_submit", function() {
            var formData = $('#reply').serialize();


            $.post("newpost.php",formData, function(data){
                    alert("hi");
             }, "json");
    });

});

My form’s id is “reply” and the button I am using to submit it is “reply-submit”, just to make sure those things are clear.

It also doesn’t work if I remove that last “json” thing btw.

  • 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-31T17:45:24+00:00Added an answer on May 31, 2026 at 5:45 pm

    If you read the docs for jQuery.post(), it says this about the callback:

    success(data, textStatus, jqXHR)
    A callback function that is executed if the request succeeds.

    If it’s not getting called, it means that request did not succeed. There is probably an error in newpost.php (sometime after the data insert, but before it would normally exit).

    You can also catch error conditions by using the long-form jQuery.ajax() instead of the post shorthand:

    $.ajax({
        url: 'newpost.php',
        data: formData,
        type: 'post',
        dataType: 'json',
        success: function(data, textStatus, jqXHR) {
            alert('success');
        },
        error: function(jqXHR, textStatus, errorThrown) {
            alert('error!');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this problem for a while now. I tried so many things that
I have tried many things, but I'm still not getting this to work. Here's
I have tried what seems like everything - I've done similiar things many times
This should be really simple, but I have tried many solutions posted on the
I know there are many posts about this issue however I cannot find one
I have the code below but I cannot call nextPromo because it is not
I'm so close here and I've tried many things but cannot get it to
I know that my question has been answered many times but I still cannot
Over the years, I have tried many times to find a good, easy to
I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is

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.