473,382 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Hiding layers

I have a layer containing a table. The layer is inside a centered
containing table. If the layer is hidden, I want the form (surrounding
table) to collapse. I want to toggle this effect with a checkbox. I can
get the layer to come on, but not toggle. Also, it starts as hidden and
there is a big gap where the table should be. What do I do?

For the javascript, I've tried different versions of the following:
function ChangeState(){
if(document.getElementById(myCheckBox).checked){
theForm.myLayer.style.display='block';
}
}

My div tag works:
<div id="myLayer" style="display: none;">

My checkbox tag includes the following:
onClick="ChangeState();"
Jul 23 '05 #1
1 1223


Jason & Juli Cook wrote:

For the javascript, I've tried different versions of the following:
function ChangeState(){
if(document.getElementById(myCheckBox).checked){
theForm.myLayer.style.display='block';
}
}

My div tag works:
<div id="myLayer" style="display: none;">

My checkbox tag includes the following:
onClick="ChangeState();"


<input type="checkbox"
onclick="changeState(this);" ...>

function changeState (checkbox) {
var div;
if (document.getElementById &&
(div = document.getElementById('myLayer'))) {
div.style.display = checkbox.checked ? 'block' : 'none';
}
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: J P Singh | last post by:
Hi All I have situation and have not been able to work out the solution wonder if someone can suggest a solution. I have an asp form which displays holidays for an employee for various years....
1
by: Lizzy | last post by:
I have an internet application which has a progress bar show whenever the customer is requesting data from the server. This progress bar is coded to work in both Netscape 4.75 and above and IE 5.0...
6
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of...
8
by: TravelMan | last post by:
I'm trying to do a show/hide of several elements on a page and can't get it working in Netscape 4.x. All other Windows browsers are working. My elements all have the same class name. <div...
18
by: ashkaan57 | last post by:
Hi, how can I hide / show a section of a page when a link is clicked? Click on "show section" would show the section and change the link to "hide section", clicking on "hide section" would hide...
9
by: news | last post by:
I'm working on a new site for my wife's college art organization: http://www.ie-studios.net/mci/ and I'm having a problem where a PDF in an IFrame is supposed to go "invisible" (and in fact is...
5
by: Burt | last post by:
There's an architect at my 200 person company that advocates having many layers in all my C# apps. He wants web services, use case handlers, facade layers, data gateways, etc. When I ask why all...
1
by: Grimm | last post by:
I am developing an internalk inteface that integrates alot of seperate tools into one interface. The current version uses one Iframe inside a div layer for positioning. Currently the seperate web...
3
by: Inny | last post by:
Im not sure how to implement this script, it should pop the blank window only if someone clicks veiw source in the context menu or the toolbatr. help? <html> <head> <SCRIPT> <!--...
27
by: matt | last post by:
Hello group, I'm trying to become familiar with the information hiding design rules, and I have a lot (3) of questions for all you experts. AFAIK, a generic module has 2 files: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.