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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:25:14+00:00 2026-06-17T09:25:14+00:00

I am working with word press . to submit a form with Ajax i

  • 0

I am working with word press . to submit a form with Ajax i use this code .. my php code is working fine and also j Query.

But when i am getting responce from post() and printing it..
it is printing with ‘zero’ means ‘0’..
As “Mail send 0”

PHP Code

 /* Apply Online form enqueue/localize/add action/function script start*/

    wp_register_script("ajax-apply_online", get_bloginfo('template_directory')."/js/custom_js.js", array( "jquery"));
    wp_enqueue_script('ajax-apply_online');
    wp_localize_script("ajax-apply_online","the_ajax_apply_online", array("ajaxurl_apply_online" => admin_url("admin-ajax.php")));

// add actions
   add_action( "wp_ajax_apply_online", "ajax_action_apply_online" );
   add_action( "wp_ajax_nopriv_apply_online", "ajax_action_apply_online" );

   function ajax_action_apply_online(){
     echo "Mail Send";                  
  }
/* Apply Online  form enqueue/localize/add action/function script end*/

jQuery Code

 jQuery.post(the_ajax_apply_online.ajaxurl_apply_online,
                    jQuery("#apply_online_form").serialize(),
                        function(response_from_the_action_function){

                            jQuery("#errfrmMsg").val(response_from_the_action_function).css({"display":"block"});
                        }
            );
  • 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-17T09:25:15+00:00Added an answer on June 17, 2026 at 9:25 am

    try adding exit; after echo “Mail Send”;

    If some other part of the php that executes after the mail send is adding additional text this will stop it from running

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

Sidebar

Related Questions

I'm working on a word-press theme and whenever I add the code below to,
I'm trying to install word-press on my website. i have php and its working
I'm working on a word press project. I noticed that rss is not working
I am working over word press after a long long time. In my website
I'm currently working on a word press theme and every time I try to
I am using ASP.NET repeater function. Its working fine. But here all the comments
Working on a wordpress administration form. I need it to go to options.php to
As My Screen shot show that i am working on word matching game.In this
Here's my code that isn't working (it's returning true) and submits my form even
I am working on a WordPress site and I have placed the following code

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.