Jump to content

Archived

This topic is now archived and is closed to further replies.

eyegraphix

Show/hide layers

Recommended Posts

Link: http://www.kjly.com/optiontest.php

 

I have a form and at the very bottom of it where it asks "Would you like to submit money now?" I have a radio button and when it is checked "yes" I'm using the dreamweaver behavior "show=hide layers" to reveal a hidden layer. All I want is for when the layer is shown, that the text and submit button move down when the layer is revealed. You can see now that it completely covers the button and text when the layer is revealed. I've tried a few things with no success. How can I accomplish this??

 

Share this post


Link to post
Share on other sites

Basicly, use javascript

 

in the <head> tags put

 

<script type="text/javascript" language="javascript">

 

function showLayer() {

var aLayer = document.getElementById("layerID");

 

aLayer.style.display = "block"; or use aLayer.style.visibility = "visible";

}

 

function hideLayer () {

var aLayer = document.getElementById("layerID");

 

aLayer.style.display = "none"; or use aLayer.style.visibility = "hidden";

}

 

</script>

 

on the radio buttons add onClick event to each, for the yes onClick put onClick="javascript:showLayer();"

no : onClick="javascript:hideLayer();"

 

You'll need to have all the content that you want hiding/shown in a div tag, with an ID. in the Javascript code change the 'layerID' to the ID of your div tag.

 

if this doesnt work, let me know and ill actually run the code, might of slipped up somewhere. Hope it is of help.

 

Chris

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.