Alright. I expanded upon a script a friend helped me write, to create a simple check box that hides / shows content, as shown
HERE.
Unfortunately, I don't have a clue how to expand this, so that I can use more than one checkbox on the page, to open different sections.
Any help would be greatly appreciated, source code is available below:
Code:
<html>
<head>
<title>Title of page</title>
<script language="JavaScript">
function getCookie(NameOfCookie)
{ if (document.cookie.length > 0)
{ begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{ begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
return null;
}
function setCookie(NameOfCookie, value, expiredays)
{ var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
function delCookie (NameOfCookie)
{ if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function showhidefield() {
if (document.frm.chkbox.checked)
{
document.getElementById("hideablearea").style.display = "block";
setCookie("fieldshown","true",31);
}
else
{
document.getElementById("hideablearea").style.display = "none";
setCookie("fieldshown","false",31);
}
}
window.onload = function () {
var c = getCookie("fieldshown");
if (c) {
document.frm.chkbox.checked = (c == "true");
}
showhidefield();
}
</script>
</head>
<body>
<form name='frm' action=''>
<input type="checkbox" name="chkbox" onClick="showhidefield()" checked="checked">
<div id='hideablearea' style='display:none'>
Hidden / displayed text...
</div>
</form>
</body>
</html>
Thanks a lot.