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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:23:54+00:00 2026-05-25T20:23:54+00:00

Sorry for maybe incorrect title for the topic, but this is the best that

  • 0

Sorry for maybe incorrect title for the topic, but this is the best that I came up with.

So, I’m building admin panel for a website.

I have a page, and in some part of the page, i’d like to refresh it and load another form.

let’s say add a schedule, and somewhere down on the page I’d like to have this form displayed as soon as the link is clicked.

when a user saves it, I’d like that form to disappear and and in stead of that to have a list displaying all of the schedules.

enter image description here

I don’t want to use frames – I’m not a supporter of frames. The panel is built using PHP.

Maybe this might be achived with Ajax? If yes -> How? any link to good example or tutorial.

  • 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-25T20:23:55+00:00Added an answer on May 25, 2026 at 8:23 pm

    yes this will be solved with ajax.

    Here is a code example when the page is supposed to refresh

    $('#button').click(function() {
        $.ajax({
            url: 'path/to/script.php',
            type: 'post',
            dataType: 'html', // depends on what you want to return, json, xml, html?
                           // we'll say html for this example
            data: formData, // if you are passing data to your php script, needed with a post request
            success: function(data, textStatus, jqXHR) {
                console.log(data); // the console will tell use if we're returning data
                $('#update-menu').html(data); // update the element with the returned data
            },
            error: function(textStatus, errorThrown, jqXHR) {
                console.log(errorThrown); // the console will tell us if there are any problems
            }
        }); //end ajax
    
        return false; // prevent default button behavior
    }); // end click
    

    jQuery Ajax

    http://api.jquery.com/jQuery.ajax/

    Script explained.

    1 – User clicks the button.

    2 – Click function initiates an XHR call to the server.

    3 – The url is the php script that will process the data we are sending based on the values posted.

    4 – The type is a POST request, which needs data to return data.

    5 – The dataType in this case will be html.

    6 – The data that we are sending to the script will probably be a serialization of the form element that is assigned to the variable formData.

    7 – If the XHR returns 200, then log in the console the returned data so we know what we are working with. Then place that data as html inside the selected element (#update-menu).

    8 – If there is an error have the console log the error for us.

    9 – Return false to prevent default behavior.

    10 – All done.

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

Sidebar

Related Questions

Sorry if this is generic in nature, but I have a question that maybe
Sorry if this is on the wrong site ( maybe superuser ) but I'm
Sorry the title isn't more help. I have a database of media-file URLs that
Hi Sorry for this noob question but here goes...i have a working slidetoggle on
Sorry for the vague title, but this is kind of hard to put into
Sorry for maybe dumb question, but i have HUGE problem with one case when
Sorry for this maybe foolish question but i'm newbie to SQL Server. Here structure
I'm sorry for maybe making such a basic question but in ASP.NET websites what
this maybe a noobish question so sorry, is it possible to run c programmes
Sorry for this not being a real question, but Sometime back i remember seeing

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.