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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:07:18+00:00 2026-06-13T17:07:18+00:00

I am needing to load the content of each tab, one at a time

  • 0

I am needing to load the content of each tab, one at a time and not until the user clicks the submit button on each form.

I know this has been addressed several times, but I cannot find a specific answer to how I am loading my content in tabs. So here it goes:

PARENT PAGE HTML

<!--Content Area -->
<div id="tab-container">
<!--Tabs Area -->
<div id="tabs">
    <ul>
                <li><a href="#tabs-1">PAGE1</a></li>
                <li><a href="#tabs-2">PAGE2</a></li>
                <li><a href="#tabs-3">PAGE3</a></li>
                <li><a href="#tabs-4">PAGE4</a></li>
                <li><a href="#tabs-5">PAGE5</a></li>
                <li><a href="#tabs-6">PAGE6</a></li>
    </ul>
<!--End Tabs Area -->
<!--Tabs Content Area -->
    <div id="tab-content">
            <div id="tabs-1">
            </div>
            <div id="tabs-2">
            </div>
            <div id="tabs-3">
            </div> 
            <div id="tabs-4">
            </div>        
            <div id="tabs-5">
            </div>  
            <div id="tabs-6">
            </div>  
    </div>            
</div>
<!--End Tabs Content Area-->
</div>
<!--End Content Area-->
</div>

JAVASCRIPT

$(function() {

    $("#tabs").tabs({disabled: [0,1,2,3,4,5]});

)};

        $('#tabs-1').load('data/PAGE1.htm');
        $('#tabs-2').load('data/PAGE2.htm');
        $('#tabs-3').load('data/PAGE3.htm');
        $('#tabs-4').load('data/PAGE4.htm');
        $('#tabs-5').load('data/PAGE5.htm');
        $('#tabs-6').load('data/PAGE6.htm');

CHILD PAGE WITH FORM

JAVASCRIPT

$(function() {
    $('#submit1').click(function() {
        var name= $("#firstname").val();
        var genderx= $("#gender").val();
        $.ajax({
            async : "false",
            type: "POST", 
            url: "http://localhost/test/ActionServlet",
            data: { step : 1, firstname: name, gender: genderx },
            success: function(data) {
                var $emptabs = $('#tabs').tabs();
                var selected = $emptabs.tabs('option', 'selected');
                $emptabs.tabs("option", "disabled", []);
                $emptabs.tabs('select', selected+1);
                $emptabs.tabs("option", "disabled", [0,2,3,4,5]);
                $("h2").html(data);
            }

        });
    });
});
  • 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-13T17:07:19+00:00Added an answer on June 13, 2026 at 5:07 pm

    Okay, I have found a solution for this and will share it with you all. This is actually – from what I have seen others doing – a much simpler way to do this.

    Just to recap – there is a form for each tab and only the tab that has focus is enabled – all others are disabled. There is a callback from the server each time the form is submitted to verify the data was received and a message showing the information that was received is displayed – this is to make sure duplicate information is not submitted to the database but no information is added to the database at this time. At the end of the process there is a final submit button that will submit all the forms for final inclusion to the database.

    All of this worked fine until we tried to load one page at a time instead of all the pages at the same time. There was a serious delay from the time the parent page loaded until the content of the first tab showed up – that’s what started all of this. For whatever reason though, solutions that would work in HTML did not work in JSP but we finally came up with the following solution that works in both.

    Parent page –

    JAVASCRIPT – top of page in HEAD tag

    var $emptabs;
    $(function() {
        $("#tabs").tabs({disabled: [0,1,2,3,4,5]});
        $emptabs = $('#tabs').tabs();
    });
    

    HTML

    <!--Tabs Area -->
        <div id="tabs">
            <ul>
                    <li><a href="#tabs-1">Personal</a></li>
                    <li><a href="#tabs-2">Emergency</a></li>
                    <li><a href="#tabs-3">Job Related</a></li>
                    <li><a href="#tabs-4">Salary</a></li>
                    <li><a href="#tabs-5">Miscellaneous</a></li>
                    <li><a href="#tabs-6">Dependents</a></li>
            </ul>
    <!--End Tabs Area -->
    <!--Tabs Content Area -->
        <div id="tab-content">
                <div id="tabs-1">
                </div>
                <div id="tabs-2">
                </div>
                <div id="tabs-3">
                </div>
                <div id="tabs-4">
                </div>       
                <div id="tabs-5">
                </div> 
                <div id="tabs-6">
                </div> 
            </div>           
        </div>
    <!--End Tabs Content Area--> 
    

    JAVASCRIPT – bottom of the page has to be after the tabs code

     $('#tabs-1').load('tabeedata/EmployeeGenInfo.htm');
    

    Here is the code for the child pages – pages with the form.

    JAVASCRIPT –

    $(function() {
        $('#submit1').click(function() {
            var name= $("#firstname").val();
            var genderx= $("#gender").val();
            $.ajax({
                async : "false",
                type: "POST",
                url: "http://localhost/test/ActionServlet",
                data: { step : 1, firstname: name, gender: genderx },
                success: function(data) {       
                    var selected = $emptabs.tabs('option', 'selected');
                    $emptabs.tabs("option", "disabled", []);
                    $('#tabs-2').load('tabeedata/EmployeeEmergInfo.htm');
                    $emptabs.tabs('select', selected+1);
                    $emptabs.tabs("option", "disabled", [0,2,3,4,5]);   
                    $("h2").html(data);
                }     
            });
        });
    });
    

    As it was suggested by addams to put

    $('#tabs-1').load('page.htm');
    

    within the success handler it wouldn’t work until we got rid of the individual

    $emptabs = $('#tabs').tabs();
    

    calls and made a global call on the parent page that looks like this:

    var $emptabs;
    $(function() {
        $("#tabs").tabs({disabled: [0,1,2,3,4,5]});
        $emptabs = $('#tabs').tabs();
    });
    

    then we were able to call each page on the submit button.

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

Sidebar

Related Questions

I have a form where a user can select a rating from 1-5. Each
In my application, I have so far avoided needing to load any jQuery stylesheets
I often find myself needing to write functions to load/save from/to ASCII (or similar)
I'm needing an A/B testing solution that is not conversion or goal oriented. What
I have found myself in the position of needing to update one or two
I'm needing to load an XML document into PHP that comes from an external
How to down load a file after clicking a download button programatically, and therefore
Let's imagine a web page page needing to load a javascript file (i.e. my.js
I was until recently using $.load() to get a specific piece of another page
I'm just needing a simple bit of code for vb.net that will allow me

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.