Can you create a expand collapse boxes in php/

Posted on 2009-02-23
Last Modified: 2012-06-27
hi everyone

i wanted to know if u can create an expand-collapse div in php/
i googled and found a code for javascript. even that will work

but my main problem is that i want totals of the columns as a summary and when i expand i want to see each individual transaction.

technologies used in the project are

so please if any oneis able to help me in this.
Question by:jhawarmayank
    LVL 6

    Accepted Solution

    Well why don't you just output the JavaScript with the data from PHP or ASP.  Most of these scripts just use a div and a toggle function.

    <p><a onclick="switchMenu('short');switchMenu('long');" title="Switch the Menu">Switch it now</a></p>

          <div id="short">
          <p>Total Sales: {$totalsales}, Average Sales: {$averagesales}</p>      
           <div id="long">';
          //loop and output all the records
    echo '</div>';

    Then on your page load you tell it to hide the detailed one.  So then every time you click the link it will alternate between the two divs.

    <body onload="switchMenu('long');">

    You can get the javascript here:

    LVL 5

    Assisted Solution


    you can use Ajax Control Tool Kit - Collapsible Panel- if you choose to go by this path with ASP.NET

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    The viewer will learn how to dynamically set the form action using jQuery.
    Viewers will learn how the fundamental information of how to create a table.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now