Hello,
I came across some code which shows and hides form fields and uses a Div so a few lines of the form slides up or down and depending on whether or not the form fields are visible or hidden from the Check Box selection
here is the link http://www.tek-tips.com/faqs.cfm?fid=4585
I want to do this but instead of using a check box, I want to use a Graphic image button hyperlinked to the Javascript function
I am not a javascript programmer, but I figured that I can achieve the desired using cookies.
Here is my effort, I do not think the cookies are working properly, I just want them to store a state and then that state gets updated next time around
my code, can anyone assist me, I am not a javascript coder just basic basic knowledge.
<head>
<script language="JavaScript">
function showhidefield()
{
if (document.frm.chkbox.checked)
{
document.getElementById("hideablearea").style.visibility = "visible";
}
else
{
document.getElementById("hideablearea").style.visibility = "hidden";
}
}
</script>
<script language="JavaScript">
function showhidefield1()
{
if (document.frm.chkbox.checked)
{
document.getElementById("hideablearea").style.visibility = "visible";
}
else
{
document.getElementById("hideablearea").style.visibility = "hidden";
}
}
</script>
</head>
<body>
<form name='frm' action='nextpage.asp'>
<a href="" OnClick="showhidefield()"><img src="familybutt.jpg"></a>
Reveal the message below
<br>
<div id='hideablearea' style='display:none'>
<br>
hello world message is displayed here
</div>
</form>
<script language="JavaScript">
function showhidefield()
{
if (document.cookie == "A")
{
document.getElementById("hideablearea").style.display = "none";
document.cookie = "name1=A";
}
else
{
document.getElementById("hideablearea").style.display = "block";
document.cookie = "name1=b";
}
}
</script>
<body>