473,785 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hiding boxes dynamically in ie

I've got 3 'alternative' boxes, only one of which I want displayed,
according to the value of an earlier select (so I'm using the
<htmlelement>.s tyle property from javascript).

One is a div containing text, which I amend as appropriate with innerhtml
One is an image.
One is a div containing 4 input text boxes, which are disabled or not as
appropriate.

I've tried .style.visibili ty = "hidden" / "visible" (correctly leaves
blank space, which I don't want)
I've tried .style.display = "none" / "block" (works for moz, ie treats
as visibility)
I've tried setting .style.height & width to "0px" / null (doesn't work
for ie).

Any suggestions as to how to make the thing disappear and occupy no
space (dynamically) in ie as well as other browsers please ?
If anyone really needs to see the page, go to ccaweddingsdire ct.co.uk/basket
login with chris at ccagroup co uk (you'll need to accept a cookie) -
the password is set to testz (it doesn't confer any great privilege,
just accesses my test shopping basket).
then click 'enter personalisation ' for 4D01 (christmas card)
Select different wordings to change the bottom section - 10 and 'your
own wording' are the intereesting two, and orderpg.js is the js file.
It's an incomplete work in progress, sorry.

Thanks,
Chris
Jul 23 '05 #1
4 1669
Chris Sharman <ch***********@ sorry.nospam> wrote in message news:<cf******* ************@ne ws.demon.co.uk> ...
I've got 3 'alternative' boxes, only one of which I want displayed,
according to the value of an earlier select (so I'm using the
<htmlelement>.s tyle property from javascript).

One is a div containing text, which I amend as appropriate with innerhtml
One is an image.
One is a div containing 4 input text boxes, which are disabled or not as
appropriate.

I've tried .style.visibili ty = "hidden" / "visible" (correctly leaves
blank space, which I don't want)
I've tried .style.display = "none" / "block" (works for moz, ie treats
as visibility)
I've tried setting .style.height & width to "0px" / null (doesn't work
for ie).

Any suggestions as to how to make the thing disappear and occupy no
space (dynamically) in ie as well as other browsers please ?


To make a long story short (I tried to post the long story and
google puked), use an iframe if you can. There are other problems
with hiding divs, especially if you're using input fields and
buttons. I had discussed similar problems in this ng a few
months ago, and it seems that an iframe is the best workaround.
There are other way cool things you can do with iframes. It's
good practice to create them dynamically rather than directly
in code.
Jul 23 '05 #2
Razzbar wrote:
Chris Sharman <ch***********@ sorry.nospam> wrote in message news:<cf******* ************@ne ws.demon.co.uk> ...
I've got 3 'alternative' boxes, only one of which I want displayed,
according to the value of an earlier select (so I'm using the
<htmlelement> .style property from javascript).

One is a div containing text, which I amend as appropriate with innerhtml
One is an image.
One is a div containing 4 input text boxes, which are disabled or not as
appropriate .

I've tried .style.visibili ty = "hidden" / "visible" (correctly leaves
blank space, which I don't want)
I've tried .style.display = "none" / "block" (works for moz, ie treats
as visibility)
I've tried setting .style.height & width to "0px" / null (doesn't work
for ie).

Any suggestions as to how to make the thing disappear and occupy no
space (dynamically) in ie as well as other browsers please ?

To make a long story short (I tried to post the long story and
google puked), use an iframe if you can. There are other problems
with hiding divs, especially if you're using input fields and
buttons. I had discussed similar problems in this ng a few
months ago, and it seems that an iframe is the best workaround.
There are other way cool things you can do with iframes. It's
good practice to create them dynamically rather than directly
in code.


I don't think that would work for a form that spanned the [un]hidden
fields, as well as the controlling select and others.

Anyway, if you've still got the long story, please mail to me at
ccagroup co uk (just fill in the dots and my name)

Thanks,
Chris Sharman
Jul 23 '05 #3
Chris Sharman <ch***********@ sorry.nospam> wrote in message news:<41******* *******@sorry.n ospam>...
Razzbar wrote:
To make a long story short (I tried to post the long story and
google puked), use an iframe if you can. There are other problems
with hiding divs, especially if you're using input fields and
buttons. I had discussed similar problems in this ng a few
months ago, and it seems that an iframe is the best workaround.
There are other way cool things you can do with iframes. It's
good practice to create them dynamically rather than directly
in code.


I don't think that would work for a form that spanned the [un]hidden
fields, as well as the controlling select and others.


The idea is to put the form on a doc contained in an iframe.

Anyway, if you've still got the long story, please mail to me at
ccagroup co uk (just fill in the dots and my name)


Well, you know how it is when you have a problem and solve it; you
remember the solution rather than the problem (hopefully), so I
had a little trouble recalling exactly what problems I was
encountering by using a div. But using the iframe solved it.

I found this page that demonstrates the problem however. There's
a draggable div in the upper right of the page, and when you
try to drag it over a select box, you see that you can't. If
you use an iframe instead of a div, you can.

http://tinyurl.com/5gfso

But I fear we are drifting from your original problem... Hope
it helps anyhow...
Jul 23 '05 #4
> I've tried .style.display = "none" / "block" (works for moz, ie treats
as visibility)


You were close. Sergio in a post to "Re: show/hide used on checkboxes
not working on IE6" used "" instead of "block". See the article:

http://groups.google.com/groups?hl=e...news.skynet.be

I tried it out in this file. I tried it in Netscape 7.1 and IE 5.2 on
MacOS 10.2.6.

<html>
<head>
<title>forms checking</title>
<script type="text/javascript">

function changeDisplay(t heWhat) {
var theDisplay;

alert("in changeDisplay changeDisplay.d isplay[" +
theWhat + "] = " +
changeDisplay.d isplay[theWhat]);

if (changeDisplay. display[theWhat] == true)
{
theDisplay = "none";
changeDisplay.d isplay[theWhat] = false;
}
else
{
theDisplay = "";
changeDisplay.d isplay[theWhat] = true;
}

// Check if the getElementById method is available
if (document.getEl ementById)
{
document.getEle mentById(theWha t).style.displa y = theDisplay;
}
else if (document.all)
{
// Path not tested...
alert("Running an older version of IE.");
document.all[theWhat].style.display = theDisplay;
}
else
{ alert("Cannot change visibility of the display element." +
" Was " + theWhat); }

}

// Toggls to keep track of when to display and not display
// a element
changeDisplay.d isplay = [ ];
changeDisplay.d isplay["comesAndGo es"] = true;
changeDisplay.d isplay["worddisapp ear"] = true;

</script>
</head>

<body>
<p>Please try out our changing display</p>
<div id="comesAndGoe s">
<p >This is our disappearing and reappearing
paragraph.</p>
</div>

<form>
<button name="myButton"
onclick="change Display('comesA ndGoes');
return false;">Toggle
display of prior sentence.</button>
</form>

<p>This is our disappearing and
reappearing<spa n id="worddisappe ar"> word</span>.</p>
<form>
<button name="myButton"
onclick="change Display('worddi sappear');
return false;">Toggle
display of the word in the prior sentence.</button>

</form>
</body>
</html>
Robert
Jul 23 '05 #5

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

Similar topics

4
397
by: StressPuppy | last post by:
(posted this in VB group but then realized I probably should have posted here) I have a TabControl with several TabPages. Upon startup, I only want to show the first TabPage, hiding the rest. Then once the user does some things, I will show the other TabPages. I have tried by putting TabPage2.Hide() in the Form_Load event, but no luck. I put the same in a button to see if it was a timing issue with loading. Still nothing.
2
1412
by: Varad | last post by:
Hi all I have been fighting to get this working.. I have a form with several text boxes which posts back when an user fills and submits. I want to hide the textboxes on postback and display some message based on some server rules. Do I have to loop through each and every text box and set the visible property to False? Or is tehre some easier way to do? Please give me some code hint. Thanks V
2
2900
by: Tim Graichen | last post by:
I currently have a form with several combo boxes. I have the background properties and boarder properties of all form fields set as transparent. Therefore, the only part of the controls that are visible, is just the drop down arrow button on the combo boxes. Is there a way of hiding this button until the field has focus? Thank you for your help Tim G
0
1202
by: Mark Reed | last post by:
Hi all, Access 2002 XP platform. I am trying to learn a little about programming (I know next to nothing so far) and have found some code which hides the toolbars. However, this bit of code is a little too effective and hides all of them including hiding the database window. What I am after is the same effect as disabling all the check boxes in startup which still leaves 'File', 'Edit', 'Insert','Records','Window' &'Help'. I want to do...
2
1916
by: muthu | last post by:
Hi freinds, In my aspx page i have generated some check boxes dynamically using dhtml. When i check any check box and submit the form,how can i capture the value of check box. How should i identify wich check box is been checked.And the check boxes are not server controls.They are the ordinary html check boxes.Can any one help me out
2
3626
by: Jason James | last post by:
Hi, I have a datalist that contains a series of thumbnails. I am in the process of paging this datalist so that only 20 images are displayed at a time. Each image has associated with it a pair of dropdown boxes. The user selects theor choices from the dropdown boxes and then moves to the next series of 20 images. The postbackURL of the button click contains the information regarding the next page to display.
1
7496
by: vega80 | last post by:
Hi. I have a problem with assigning an onkeypress-function to dynamically created input-boxes.I want to put the content of an input-field into a tag-list when the user hits enter. This works fine the first time (when the input-field is created in a non-dynamical way). The next input-field is created dynamically by a function that is called when the user hits enter (the previously generated input-field will be hidden). Then I'm trying...
5
3899
by: HowardChr | last post by:
I have my program set up so that when a button called "Clear" is clicked, it clears all Yes/No fields from a seperate table. The problem is that when that button is clicked, it is coming up with 2 seperate message boxes making sure that is what they want to do. The first one says: "are you sure you want to run that query", and the second says "You are about to update 1 row". Is there a way to code this so those message boxes are either...
1
4913
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have set text boxes and labels inside the table rows. I then added a button. All of these are done through code. The problem that i am having is i can get the value from a text box with resides inside the first panel (out side of panel that is...
0
9646
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
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10096
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
9956
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
6742
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
5386
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...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.