I'm trying to toggle a form. What's wrong with this?
Code:
<script type="text/javascript" language="javascript1.3">
function toggle(id){
ol = "ol_" + id;
img = "img_" + id;
olElement = document.getElementById(ol);
imgElement = document.getElementById(img);
if (olElement){
if (olElement.className == 'closed'){
olElement.className = "open";
imgElement.src = "images/opened.gif";
}else{
olElement.className = "closed";
imgElement.src = "images/closed.gif";
}
}
}
</script>
<a onclick="toggle('item1');">
<h5><img src="images/closed.gif" alt="Click to Expand" id="img_item1" border="0" /> Email it to Someone</h5></a>
<ol type="none" id="ol_item1" class="closed">
<li id="item1_1">
<form name="mailing" method="post" action="article.asp?id=1447#send" enctype="application/x-www-form-urlencoded">
<input name="send" type="hidden" value="1" />
<div id="div10a">SEND THIS WEBSITE TO A FRIEND:</div>
<div id="div10b">From: </div>
<div id="div10c">
<input type="text" name="name" size="20" value="[your e-mail address]" class="form-input" onblur="if(this.value==''){this.value='[your e-mail address]';}" onfocus="if(this.value=='[your e-mail address]'){this.value='';}" />
</div>
<div id="div10d">
<input name="submit" type="submit" title="Send it" value=" Send " size="100" />
<input name="reset" type="reset" value="Reset" />
</div>
<div id="div10e">To: </div>
<div id="div10f">
<input type="text" name="name" size="20" value="[recipient e-mail address]" class="form-input" onblur="if(this.value==''){this.value='[recipient e-mail address]';}" onfocus="if(this.value=='[recipient e-mail address]'){this.value='';}" />
</div>
</form>
</li>
</ol>