Solved

IE v/s Netscape

Posted on 2001-06-06
2
164 Views
Last Modified: 2010-04-09
I have got a problem of few HTML tags' properties working in IE and not working in Netscape. I 'm sending the code. Could some one help me on this :

function checkVisible(main_form,fld)
{

document.main_form.elements[fld].style.visibility="visible";
     
}

function checkInvisible(main_form,fld)
{

     document.main_form.elements[fld].style.visibility="hidden";

}


This fn is bassically to hide a control on click of a radio button and make it visible on click of the other radio button
0
Comment
Question by:arun_dp
2 Comments
 
LVL 1

Accepted Solution

by:
HHH earned 50 total points
ID: 6159064
Maybe you can use this:

if (document.layers) //NS
{
     visible = 'show';
     hidden = 'hide';
}

else //IE
if (document.all)
{
     visible = 'visible';
     hidden = 'hidden';
}

else //NS 6
if (document.getElementById)
{
          visible = 'visible';
          hidden = 'hidden';
}


if (document.layers) {
    document.layers[fld].visibility=hidden;

}
else if (document.all) {
   document.all(fld).style.visibility=hidden;

}
else if (document.getElementById) {
   document.getElementById(fld).style.visibility=hidden;
}



0
 
LVL 9

Expert Comment

by:nimaig
ID: 6159115

You cannot hide a form element in Netscape. You need to put the form element in a Layer and hide and show the layer.

For hiding a layer you can use
document.<LAYERNAME>.visibility = "hide"
document.<LAYERNAME>.visibility = "show"
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now