473,416 Members | 1,953 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,416 software developers and data experts.

<div style:visibility="hidden">

Hi,
I am dynamically generating a html file which will contain only <div> tags which contents are hidden from user( set by style="visibility:hidden")
Now the next step is i am enabling some of these tags by setting style="visible" here the problem is, the hidden items also occupy the space on html form is there any other ways such that all the content should present on html form in hidden form and run time I can make visible some of them as per requirement thru javascript?
Jan 12 '07 #1
7 201502
CSS "visibility" property hides an element but retains its space in the flow of the document. If you want to remove an element from the flow of a document (not just make it invisible, but allocate its space to other elements, which is what I think you want to do) then use "display: none".
Jan 12 '07 #2
Hi,

Doc-1:
<div style="visibility:hidden">Line1</div>
<div style="visibility:hidden">Line2</div>
<div style="visibility:hidden">Line3</div>
<div style="visibility:hidden">Line4</div>
<div style="visibility:hidden">Line5</div>
Jan 12 '07 #3
Hi,
My code is like,

File--> doc1.html

<div style="visibility:hidden">Line1</div>
<div style="visibility:hidden">Line2</div>
<div style="visibility:hidden">Line3</div>
<div style="visibility:hidden">Line4</div>
<div style="visibility:hidden">Line5</div>

File --> doc2.shtml

This file will include all the content of above html file under body tag using Shtml include tag.
A java script function will make the Line1 and Line4 visible.

Now my target is to show the visible lines one by one. In current situation it appears as:

Line1
<blank>
<blank>
Line4
<blank>


Is there any alternative to this implementation?
Please guide me..
Thanks
-Parag
Jan 12 '07 #4
drhowarddrfine
7,435 Expert 4TB
Perhaps you can do the same for each line. Identify each line with an id or class and turn each one on/off as required. Such as:

<div id="para1">
<p id="line1">Line1</p>
<p id="line2">Line2</p>
</div>

Then you can turn each line on/off using javascript and display:none or hidden as required, if I'm following this all correctly.

That can become a little complicated if it gets too big but you might give it more thought than I can right now.
Jan 12 '07 #5
AricC
1,892 Expert 1GB
Using javascript you can do this:
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
<script type="text/javascript">
function dispHandle(obj)
{
if (obj.style.display == "none")
obj.style.display = "";
else
obj.style.display = "none";
}

</script>
</head>

<body>
<div id="HideShow">Hello World!</div>
<a href="javascript:dispHandle(HideShow)">Hide Show</a>

</body>
</html>
[/html]
Jan 12 '07 #6
oranoos3000
107 100+
@parag1234567
hi
you can put per element of form in a cell of table
an allocate id to per cell
then you should write a fuction
that show or hide per cell with display properties
document.all[id].style.display="none" for hide cell this code for IE
or
document.layers[id].display="none" for hide cell this code for netscape
and with allocate "" to this property cell has shown
be successful
Jun 22 '09 #7
acoder
16,027 Expert Mod 8TB
There's no need for a table. Any container element (span/div/p, etc.) will do.

Your suggestion of document.all and document.layers is very old and unsupported in most modern browsers. Use the standard document.getElementById() to refer to elements.
Jun 22 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

13
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...
2
by: Matt | last post by:
If I do the following, the browse text box still cannot see C:/hello world/test.txt. <input type="file" name="fileName" value="C:/hello world/test.txt" size=80> Any ideas? and workarounds...
2
by: Liming | last post by:
hello, I have the follwoing code <div id="detailtable" style="visibility:hidden"> <table id="detailtablehidden" width="100%" border="0"> .... </table> </div>
32
by: fran7 | last post by:
Hi, Trying to solve a problem with no knowledge of asp. I have a dropdown list populated from my database with card decription. The output is names like, abstract,illustration etc. I am sending...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.