Snippet description Snippet class
XHTML-base XHTML
Open image in new window JavaScript
Escape variables PHP
Fread-example PHP
SQL-timestamp to normal date PHP
Remove HTML-tags from string PHP
Formatting MySQL-datetime PHP
on Rollover go to frame Flash
Hiddenable box XHTML / CSS / JS


This produces a page like this.

<!--
 Hiddenable box with javascript
 16.01.2007

 NOTE! Remove this commented area and comment-arrows when using the code!
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.toni.fi/dtd/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <title>Hiddenable content</title>
  <meta http-equiv="Content-Language" content="EN" />
  <style type="text/css">
    #hiding_button
    {
      font-weight: bold;
      border: 4px ridge #996600;
      cursor: pointer;
      width: 120px;
      height: 30px;
      background-color: #ffffcc;
    }
  </style>
  <script type="text/javascript">
    function show_or_hide_textbox(element,text)
    {
      if (document.getElementById(element).style.display == 'none')
      {
        document.getElementById(element).style.display = 'inline';
        text.value = "Hide fieldset.";
      }
      else
      {
        document.getElementById(element).style.display = 'none';
        text.value = "Show fieldset.";
      }
    }
  </script>
</head>
<body>
  <form action="" method="post">
    <input type="button" id="hiding_button"
      onclick="show_or_hide_textbox('hiddenable_fieldset',this);"
      value="Show fieldset." />
    <br /><br />
    <fieldset id="hiddenable_fieldset" style="display:none;">
      <legend>Hidden box</legend>
      This box is hiddened as default and can be hiddened again.
    </fieldset>
  </form>
</body>
</html>