Computing.Net > Forums > Web Development > Javascript, div, visibility, and IE

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Javascript, div, visibility, and IE

Reply to Message Icon

Name: Don Arnett
Date: June 12, 2007 at 12:23:06 Pacific
OS: na
CPU/Ram: na
Product: na
Comment:

I am using Javascript to change the 'visibility' between 'visible' and 'hidden' of a DIV to cause it to display or not display.

It works great, except in IE, when the DIV displays over FORM INPUT/SELECT objects, the objects show thru.

The objects do not show thru in Firefox.



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: June 12, 2007 at 23:04:58 Pacific
Reply:

IMpossible to help without seeing some code: i.e. the javascript and the pertinent inline HTML.

Michael J


0

Response Number 2
Name: Don Arnett
Date: June 13, 2007 at 05:06:46 Pacific
Reply:

I've been told from other sources that this is a known problem with IE. The only solution is to 'hide' the SELECT objects before displaying the DIV.


0

Response Number 3
Name: Michael J (by mjdamato)
Date: June 13, 2007 at 11:00:39 Pacific
Reply:

That's interesting since I can create a dynamic DIV over an input field in IE and id doesn't display that behaviour.

Michael J


0

Response Number 4
Name: Don Arnett
Date: June 13, 2007 at 14:25:25 Pacific
Reply:

IE 6.0.2900.2180
FireFox 1.5.01

Using the code below:
in IE: the DIV does not hide the SELECT
in Firefox: I cannot see the SELECT because it's underneath the DIV (once I added a background-color)

<html>
<head>
<style>
#divItemPopup {
position : absolute;
border : 1px solid black;
background-color : white;
}
</style>
<script type="text/javascript">
function showPopup()
{
obj = document.getElementById("divItemPopup")

obj.style.top = 0
obj.style.left = 0
obj.visibility = "visible"
}
</script>
</head>
<body onload="showPopup()">
<br />
<select name="myselect" id="myselect">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<div id="divItemPopup">
<br />
<br />
This is the popup
<br />
<br />
</div>
</body>
</html>


0

Response Number 5
Name: Michael J (by mjdamato)
Date: June 13, 2007 at 21:45:47 Pacific
Reply:

Ahh, I see. In your original post you stated that it did not work with "FORM INPUT/SELECT" so I tried it with an INPUT field and it worked. A SELECT and INPUT are two different things.

Michael J


0

Related Posts

See More



Response Number 6
Name: Don Arnett
Date: June 14, 2007 at 05:56:26 Pacific
Reply:

My bad.

Originally I thought that INPUT (TEXT) fields were a problem. Later I realized that I didn't have any on the particular form that I'm working on, but forgot to change the question.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Javascript, div, visibility, and IE

Help with div layers and background www.computing.net/answers/webdevel/help-with-div-layers-and-background/2257.html

JavaScript change style on events www.computing.net/answers/webdevel/javascript-change-style-on-events/2619.html

Check out my site? www.computing.net/answers/webdevel/check-out-my-site/1248.html