473,406 Members | 2,336 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,406 software developers and data experts.

-> style.visibility not working in IExplorer ??? <-

Hi,
I have a strange problem using Internet Explorer.
My page has a table included in a <DIV>
I have a checkbox that shows the div when checked
and hides it when unchecked.

var division = document.getElementById("passport") ;

Then I use
division.style.visibility = "visible" ;
or
division.style.visibility = "hidden" ;

Everything works perfectly under FireFox or Safari showing or
hidding the table.

BUT, in IExplorer 6 or 7, just checking the checkbox doesn't
change anything. You have to first click on the actual division
position to make it appear. Same for unchecking: click on the
displayed table and it will disappear.

Any clue why???
Here is the code sample.
<body>

<script language="javascript">
function showhide(selectObj) {
var status = selectObj.checked ;
var division = document.getElementById("passport") ;
if( status == true ) {
division.style.visibility = "visible" ;
}
else {
division.style.visibility = "hidden" ;
}
}
</script>
<FORM id="form1" name="form1" method="post" action="">
<INPUT name="delivered" type="checkbox" onChange="showhide(this)"
value=""/>
<label>Delivered</label></p>
<div id="passport" style="visibility:hidden">
<table width="700" border="1" cellpadding="0">
<tr>Phone:</td>
<td colspan="3">
<INPUT name="phone" type="text" size="24" />
</td>
</tr>
<tr>
<td><label for="passrecu">Pass rcvd </label></td>
<td><input type="text" id="passrecu" /></td>
<td>&nbsp;</td>
<td><label for="passdelivre">delivered</label></td>
<td><input type="text" id="passdelivre" /></td>
</tr>
</table>
</div>
</form>

</body>

Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: st*******************@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------
Dec 5 '06 #1
2 2317
Steve JORDI wrote:
<INPUT name="delivered" type="checkbox" onChange="showhide(this)"
value=""/>
For the checkbox input use onclick="showhide(this);", not onchange.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 5 '06 #2
>For the checkbox input use onclick="showhide(this);", not onchange.
Wow! That did it... it was that simple!!!

Thanks a lot for your help

Steve

Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: st*******************@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------
Dec 5 '06 #3

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

Similar topics

3
by: Québec | last post by:
Hi, I went on Honnen FAQ and tried other solutions. This is suppose to be easy? Is one of theese suppose to work on IE6? uss.visibility = visible; uss.style.visibility = visible;...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
12
by: lawrence | last post by:
The following function correctly makes everything invisible but then fails to turn the one chosen DIV back to visible. I imagine I'm getting the syntax of the variable wrong? I've tried this with...
4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
5
by: Steve JORDI | last post by:
Hi, I have a strange behavior when using IExplorer over FireFox. There is an html form that asks for the name of a city and has a dedicated field for that with a submit button next to it. In...
3
by: chris1606 | last post by:
I have an image gallery that pops up an enlarged version of a picture when someone clicks on it. That bit works, but it should also load the picture's caption into the floating layer. Instead the...
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...
3
by: Amzul | last post by:
hello all i can hide what i want and revile it with javascript but there is a problam even if its not there (style="visibility:hidden") u can still notice that something is there i mean if...
2
nirmalsingh
by: nirmalsingh | last post by:
hai all, i am using asp.net, on first time loading of a page the style is correctly applied for the div but on postback only font style is not applied. i dont know y? <div...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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
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...

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.