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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:59:08+00:00 2026-05-14T02:59:08+00:00

I have a recordset loop that creates a table, and every 9 items it

  • 0

I have a recordset loop that creates a table, and every 9 items it wraps a div around them so basically looks like:

<div>
<table>rs1, rs2 ----> rs9</table>
</div>
<div>
<table>rs10, rs11 ----> rs18</table>
</div>

etc...

Now, I want it so at first only the first div is showing and the others are hidden, but I have ASP loop that generates clickable links for the various divs (pages) and clicking on any given link will show that div and hide all the others.

Here is the asp code I have so far:

Dim i
  If totalPages > 1 Then
    Response.Write("<div id='navigation'>")
  For i=1 to totalPages
      Response.Write ("<a href='' onlick=''>"& i &"</a> | ")
  Next
  Response.Write("</div>")
  End If

Now I just need to figure out the javascript…

  • 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-14T02:59:08+00:00Added an answer on May 14, 2026 at 2:59 am

    To make this easier, you should identify your tables somehow. Give them an ID that identifies a specific resultset and a classname that identiefies all resultsets:

    <table id="resultset-1" class="resultset"> ...
    

    Then you can bind an event to the links in your navigation element:

    window.onload = function() {
        document
            .getElementById('navigation')
            .getElementByTagName('a')
            .onclick = function() {
                var id = parseInt(this.innerHTML, 10);
                document.getElementsByClassName('resultset').style.display = 'none';
                document.getElementById('resultset-'+id).style.display = 'block';
                return false;
            }
    }
    

    I haven’t tested this and my vanilla JS skills are a bit rusty, but it should work to my understanding. Just for the kicks, here’s a version using jQuery which I can guarantee to work:

    $(function() {
        $('#navigation a').click(function() {
            var id = parseInt($(this).html(), 10);
            $('.resultset').hide();
            $('#resultset-'+id).show();
            return false;
        });
    });
    

    Remember to initially hide all but the first div somehow – you don’t need to use JS for that, you can use ASP to print style="display: none;" to all tables you want to hide, for example.

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

Sidebar

Related Questions

I have data in a table that looks like the following sample data: varchar(20)
I have a recordset that contains only 1 record but I need to display
Using VBA i have a set of functions that return an ADODB.Recordset where all
I have a table with details on personnel. I would like to create a
I currently have a table that is 17 columns wide and has 30 records.
Hello i have this foreach loop that gives weird result , it displays only
I have a function that updates a MySQL table from a CSV file. The
MYSQL Database: I have a table of data that I need to put into
I simply have a table that contains a list of countries and their ISO
I have a database where I would like to construct a result that match

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.