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

  • Home
  • SEARCH
  • 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 3481248
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:25:43+00:00 2026-05-18T10:25:43+00:00

Hallo, i am new to jquery, AJAX requests. Here is my html code in

  • 0

Hallo, i am new to jquery, AJAX requests. Here is my html code in edit_page.php

                    <td>Action: </td>
                               <td class="notselected">
                                    <div id="action_response"></div>
                                    <select name="action_db1" id=<?php  echo $sel_page['Concession']; ?> onchange="updateaction(this);" >
                                        <option value=""></option>
                                        <option value="move">Move</option>
                                        <option value="copy">Copy</option>
                                        <option value="exclude">Exclude</option>
                                    </select>
                                </td>

and the javascript code is

function updateaction(item) {
        $.post("edit_page_advanced_actions.php", {concession:item.id, action:item.value, db_name:item.name},function(action_response) {
         $('#action_response').html(action_response);

        });
}

Here i am calling php script *edit_page_advanced_actions.php* in which i wrote some php code. I want to return messages from here based on the database updation to edit_page.php. i.e from the calling script.

EDIT:-

I am updating database in edit_page_advanced_actions.php. I want to return an error message or success message to edit_page.php. i.e from where this is triggered. For example “successfully updated”, “Copied successfully”,”Failed to exclude” to the users based on db operations.

How this can be accomplished.

Thanks in advance!

  • 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-18T10:25:44+00:00Added an answer on May 18, 2026 at 10:25 am

    You should return the error status in the http header using the php header function. For example:

    header("Status: 400 Bad Request");
    echo "The error is: ....";
    

    You can then use$.ajax with a special error function:

    $.ajax({
      type: 'POST',
      url: "edit_page_advanced_actions.php", 
      data: {
        concession:item.id, 
        action:item.value, 
        db_name:item.name
      },
      succes: function(data, action_response) {
         $('#action_response').html(action_response);
      },
      error: function(xhr, action_response) {
         // error code goes here
         alert(action_response);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
Hello there i have written some code in jquery to add new input type
I created a new HTML element using jQuery. var v=jQuery('<p>Hello</p>); But when I try
I am trying to populate a chart with button click. <html> <head> <script src=https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js></script>
I have a link as follows. @Html.ActionLink(Create Report, Screenreport, Reports, null, new { @class
I have these lines of code in a jquery textile parser: re = new
am new to jquery.I am doing some ajax using jquery in django. $(document).ready(function() {
I've put together some jQuery AJAX code using some tutorials I found on the
I'm completely new to jQuery and Ajax, but I've managed to learn how to
hello friends i m new to jQuery and nyro modal. right now i m

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.