PDA

View Full Version : Layer Visible



Anthonie
25 Jul 2009, 12:55 PM
Hello,

I'm not very good at javascript, therefor I'm asking for help with this. On my site I want to make it so when you click on a certain link, a layer becomes visible, this is possible by javascript, but all the scripts I've found with google only focus on showing and hiding one div. Is there anyone who can tweak the following code to work for multiple layers?



<script>
function swapform() {
var visable
var hidden
visable = document.getElementById("visible").innerHTML;
hidden = document.getElementById("theform").innerHTML;
document.getElementById("visible").innerHTML = hidden;
}
</script>

<div id="visible">
<input type="button" value="change form" onclick="swapform();">
</div>


<div id="theform" style="visibility: hidden">
<form action="blah.asp" method="post">
<table>
<tr><td><input type="text" value="Insert Name">
<tr><Td><input type="submit" value="rub a dub">
</table>
</form>
</div>