<?xml version="1.0" encoding="windows-1252"?>
<node id="682594" title="Utilitarian's scratchpad" created="2008-04-24 05:29:54" updated="2008-04-24 01:29:54">
<type id="182711">
scratchpad</type>
<author id="681898">
Utilitarian</author>
<data>
<field name="doctext">
&lt;c&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Invisible divs&lt;/title&gt;
&lt;script&gt;
function showDiv(nextDiv)
{
    for ( var dnum = 0; dnum &lt; 4; ++dnum ) // Change 4 to suit number of divs in page
    {
        var currentDiv = document.getElementById("div" + dnum);
        currentDiv.style.display = ( currentDiv.id == nextDiv ) ? "block" : "none";
    }
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="showDiv('div0');"&gt;
&lt;!-- change action below to suit your needs--&gt;
&lt;form action="/cgi-bin/assesTest.pl"&gt;
&lt;div id="div0" style="display: none;"&gt;
This will be the only bit visible at first
&lt;a href="#" onclick="showDiv('div1')"&gt;Next &amp;gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="div1" style="display: none;"&gt;
This will be visible after clicking on the link at the end of the first div
&lt;a href="#" onclick="showDiv('div2')"&gt;Next &amp;gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="div2" style="display: none;"&gt;
This will be visible after clicking on the link at the end of the second div
&lt;a href="#" onclick="showDiv('div3')"&gt;Next &amp;gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="div3" style="display: none;"&gt;
This is the last element to display
&lt;input type="submit"&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/c&gt;</field>
</data>
</node>
