• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

IE v/s Netscape

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
arun_dp
Asked:
arun_dp
1 Solution
 
HHHCommented:
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
 
nimaigCommented:

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now