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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:13:36+00:00 2026-06-12T08:13:36+00:00

I am currently trying to make my Ajax to post some informations from a

  • 0

I am currently trying to make my Ajax to post some informations from a HTML form, into a PHP form.

Well, now I have made difference codes which should be printed out at the “ajax.comment.php” page, telling what happened.

Like if it went successfully or not.

I now want to make my ajax, check what the printed html was.
And then handle on that.. Like if (Printed HTML == “1”) {Then do something}.

How can I do that?

My following javascript is:

var name = document.comment.name.value;
var email = document.comment.email.value;
var website = document.comment.website.value;
var message = document.comment.message.value;
var id = document.comment.id.value;
$.ajax({
      type: "POST",
      url: "ajax.addcomment.php",
      data: "name="+name+"&email="+email+"&website="+website+"&message="+message+"&id="+id,
      beforeSend: function() {
        // Action before sending data
      },
      success: function(returned_html) {
        // Action after sending data, where the returned_html var is the returned html text by the php
      }
  });
  • 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-12T08:13:38+00:00Added an answer on June 12, 2026 at 8:13 am

    Inside your success function, try this:

    success: function(returned_html) {
        var the_result = $.trim(returned_html);
        if(the_result == '1')
        {
            // Do whatever you wanted here.
        }
        else
        {
            // Do something else here...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to make some ajax post between cross-domains by following this tutorial
I am currently trying to make a dropbox-esque application from a tutorial and I
I am trying to make an ajax call to a php script. The php
I am trying to make a Ruby on Rails post via AJAX, and can't
Currently I'm trying to make an ajax entry delete function, when I click on
Hi i was im trying to make a jquery ajax submit form, and im
I'm trying to make updates to a model using Ajax/POST. I'd like to be
I'm trying to write an ajax POST to send a value from one ci
I'm currently trying to make a set of conversion functions which, through one call,
I'm currently trying to make an orientation calculator in java and I'm having a

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.