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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:08:46+00:00 2026-05-18T07:08:46+00:00

I have a few pages from each other to interact with page with id

  • 0

I have a few pages from each other to interact with page with id load, as below:

inside process.html

<div id="guest_details"> </div>

<div id="first_start"> </div>
<script>
<! -
$('#guest_details').load('?p=guest_details.html');
$('#first_start').load('?p=first_start.html')
$('#guest_details').hide('slow');
$('#first_start').SlideUp('slow')
->
</Script>

inside guest_details.html

<form action="guest_details.php" <form method="POST" id="guest">
<!-- Some cell here -->
<a onclick="$('#guest').submit();" class="button" id="first_start"> <span> <?php echo $button_submit;?> </span> </a>
</Form>

That I want is when the submit button is clicked then:

  1. data sent to guest_details.php
  2. If the data has been sent then hide < div id=”guest_details”> < /div>
  3. showing the show < div id=”first_start”> < /div>

but when I make it like the above, that not work, Could someone give a clue how to correct?

Thanks a lot

  • 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-18T07:08:47+00:00Added an answer on May 18, 2026 at 7:08 am

    Looking at your previous question and your tags, I assume you are not much aware of AJAX.

    You need to

    1.post the form asynchronously (without reloading the page, using AJAX).
    2. On successfully sending the data, do the dom manipulations.

    I suggest using jquery for doing an AJAX post.

    Here is a sample code, using jquery:-

    $('#guest_details').load('?p=guest_details.html');
    $('#first_start').load('?p=first_start.html')
    
    function ajaxPostForm()
    {    
      $.post('guest_details.php', 
    
      function(data) {
    
        //Dom manipulation
        $('#guest_details').hide('slow');
        $('#first_start').SlideUp('slow')
    
      });
    
     }
    

    And your form html inside guest_details.html needs to be like:-

    <form method="POST" id="guest">
    <!-- Some cell here -->
    <a onclick="ajaxPostForm();" class="button" id="first_start"> <span> <?php echo $button_submit;?> </span> </a>
    </Form>
    

    The $.post given above is a very basic AJAX post. You may add further features as give in Jquery Post.

    Also if you want to post the entire form, you can refer jQuery Form Plugin

    Updates
    I think I understood your problem better this time. Inside your update where you say this-

    by default guest_details.html is
    showing and first_start.html is hiding

    referring to the sections as guest_details and first_start would make more sense because guest_details.html may mean the page guest_details.html which you might have opened in another window.

    Anyway, I am sure you mean the sections inside the page process.html as you have used jquery .load(). Let’s call the first_start.html and guest_details.html as sections first_start and guest_details respectively.

    As per your updates do you mean the following:-

    Initial state
    Section guest_details is shown and first_start is hidden

    Cases/Situations
    When form inside guest_details section is submitted, then hide the section guest_details and show first_start section.

    At this state when guest_details is hidden and first_start is shown, the button on first_start can be clicked and on doing so the guest_details section shows again.

    During these states where one section is hidden and another is shown reloading/refreshing the page should preserve the states.

    If above is the complete scenario, here is the code:-

    <script>
    <! -
    initiateSections(<?php echo $this->session->data['display_state']; ?>);
    //state can have "display_first_start" or "display_guest_details"
    function initiateSections(state)
    {
        $('#guest_details').load('?p=guest_details.html');
        $('#first_start').load('?p=first_start.html')
    
    
        if(state == "display_first_start")
        {
            displayFirstStart();
        }
        else
        {//If chosen or by default
            displayGuestDetails();
        }
    
    }
    
    function ajaxPostGuestDetails()
    {    
      $.post('guest_details.php',  //In this post request - set $this->session->data['display_state'] = 'display_first_start'; in php
    
      function(data) 
      {
            //Dom manipulation
        displayFirstStart();
      });
    
    }
    
    function ajaxPostFirstStart()
    {    
      $.post('first_start.php',  //In this post request - set  $this->session->data['display_state'] = 'display_guest_details'; 
    
      function(data) 
      {
        //Dom manipulation
            displayGuestDetails();
      });
    
    }
    
    function displayGuestDetails()
    {
        $('#first_start').hide('slow');
        $('#guest_details').slideUp('slow');
    }
    
    function displayFirstStart()
    {
        $('#guest_details').hide('slow');
        $('#first_start').slideUp('slow');
    }
    ->
    </Script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few divs set next to each other making a horizontal scrolling page.
I have a few static pages that are just pure HTML, that we display
I am developing a simple website with few JSP pages. Each jsp does have
i have a web page where there are 2 dropdowns next to each other.
I've got a few HTML pages with the requisite images, css and other bits
I have few pages in following structure. --Project |---WebContect |----Admin/ * |----Author/ * |----Readonly/
I have a few pages on my asp.net website that I would like to
I have a few pages and want that they use one style. See in
I'm trying to redirect a few pages to a new domain and I have
I have a head file which I am using for a few different pages.

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.