473,839 Members | 1,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Revealing hidden html text

I have a <div> section of text in my page that I want to make visible
via an input check box associated with an OnClick javascript.
I can do this OK but the problem is that the space for the hidden text
is reserved on the page (i.e. thare is a gap). The user clicks the
button to make the text visible or not visible.
What I really want is for the page to expand (open up) to reveal the
text if the user checks the box and contracts again if the box is
unchecked. Much neater.
Here are the important bits of the code so far :-

<style type="text/css">.hidden { position: relative; visibility:
hidden; }</style>

.............

<SCRIPT LANGUAGE="JavaS cript">

function set(What,Value)
{

if (document.layer s && document.layers[What] != null)
document.layers[What].visibility = Value;
else
if (document.all)
eval('document. all.'+What+'.st yle.visibility ="'+ Value+'"');
}

function click1(Form,Rad io,Layer)
{
vv = "visible"
hh = "hidden"
if (Form.C1.checke d)
{set(Layer,vv); }
else
{ set(Layer,hh);}
}
</SCRIPT>

...........

<td align="left" valign="top" width="100%"><i nput type="checkbox"
name="C1" onClick="click1 (this.form,this .name,'L1')" value="OFF"><di v
class="hidden" id="L1"><ul><li >xxx</li><li>yyy</li></ul></div></td>
Can you help?
Thanks.
Jul 20 '05 #1
2 7551
Andrew hu kiteb:
I have a <div> section of text in my page that I want to make visible
via an input check box associated with an OnClick javascript.
I can do this OK but the problem is that the space for the hidden text
is reserved on the page (i.e. thare is a gap). The user clicks the
button to make the text visible or not visible.
What I really want is for the page to expand (open up) to reveal the
text if the user checks the box and contracts again if the box is
unchecked. Much neater.
Here are the important bits of the code so far :-

<style type="text/css">.hidden { position: relative; visibility:
hidden; }</style>


use the display stylesheet attribute instead of visibility. That way,
screen space is not reserved for the object.

--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #2
Can you expand a little on display stylesheet attribute - not familiar.

Thanks.
Jul 20 '05 #3

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

Similar topics

13
40782
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
6
2519
by: calfliu | last post by:
hello: everybody! I have a simple question. How can I translate the selected value from art to recipient(hidden input button)? <form name="send" method="post" action="send.cgi"> <select name="art" size="1" style=font-size:9pt onChange="Setvalue()"> <option value="ad2">ad</option>
6
1920
by: GoCMS | last post by:
Hi, guys: I am trying debug other people(who has left company)'s ASP code, and had difficulty understanding the use of a hidden asp page. The application has an index page, like MyIndex.asp which has nothing but a couple of other asp files, like <frameset COLS="0,0,52%, *"> <frame NAME="hidden" SRC="MyHidden.asp"> <frame NAME="content" SRC="MyContent.asp"> </frameset>
3
2224
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a hidden field respectfully and the value from dynamically created hidden fiields in to a text fieldin to a text field all at the same time Here's the code as viewed through the browser <body bgcolor="#FFFFFF" text="#000000" > <SCRIPT...
1
1860
by: Madame Blablavatsky | last post by:
hello, i am trying to build a kind of very, very simple ritch text editor for people to use with a very simple cms. at the moment i am working on the basic structure. the text is put in an iframe. then a hidden textfield gets the value from the content of that iframe. then the hidden textfield is sent to a php-page so it can be put in a
16
1956
by: Ed Mullen | last post by:
I've investigated a bit how to have hidden lines of text (could be just text or could be links) appear when clicking on a link in an HTML page. Example describing what I'd like it to look like is at: http://edmullen.net/temp/example.html I'm perfectly willing to go read and research but I'd appreciate some clues as to what I should look for (I've seen a variety of possibilities after doing some Googling). I would want to use strict...
17
1940
by: ApexData | last post by:
Hello Split DB (FE & BE) Linked. FE compiled to MDE. For security reasons, I have hidden the BackEnd. However, If the network is down or the FE can't find the Backend, then an Access Error reports exactly where the Backend is. This blows my attempt at hidding the Backend file. I have tried to use the DIR() statement to look for the BE in my FormOpen of my 1st form but it seems to be ignored.
2
15579
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height. So here's the problem: Without the inner divs having a width and height set, the overflow:hidden doesn't...
1
1952
by: Jeff User | last post by:
hi all Using C#, .NET1.1. I need to pass a string of text to the final html output and then capture it with java script on the client side. I found that I can place my string in and then access a textbox or a label from the js, but only if the textbox or label is visible. If they are hidden (and then need to be) then they are not created in the html output.
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10588
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10650
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10295
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7830
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7019
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.