Jump to content

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??

 

Link to comment
https://forums.phpfreaks.com/topic/2695-showhide-layers/
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

Link to comment
https://forums.phpfreaks.com/topic/2695-showhide-layers/#findComment-9043
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.