Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding form elements

Status
Not open for further replies.

aarrgghh

Technical User
Sep 5, 2002
60
US
any ideas on how to hide <form> elements with onMouseOver in NS4.72?

I can get it to work with every other browser except NS4.7X. Heres wat Ive tried:

function hide(){
if (document.getElementById){
document.getElementById("form").style.visibility = 'hidden';}
if(document.all){document.all("form").style.visibility = 'hidden';}

}
 
try this

function hide(){
if (document.getElementById)
document.getElementById("form").style.blocked='none';

if(document.all)
document.all("form").style.visibility = 'hidden';
}

 

Didn't he say NS4? I'll be shocked all to hell if NS4 understands getElementById().
 
As far as I remember (and frankly, I want to forget :E) NS4 had non-standard values for visibility - show/hide instead of visible/hidden.

If getElementById doesn't work, access form through document.forms. Or wrap it into div/layer/whatever and use document.layers.




 
oh yeah - i missed that bit, still we can always emulate the getelementbyid method:

Code:
document.version = parseFloat(navigator.appVersion);
document.hostApplication = navigator.appName.substring(0,3);
document.browserClass = parseInt(document.version);

if(document.browserClass < 4){}else
if(document.browserClass == 4){if(document.hostApplication == "Net")
{function _style()
 {this.layerRef = null;    
  this.watch("visibility", function(id, old, nval){eval("this.layerRef." + id + " = '" + nval + "'");return nval;});
  this.watch("top", function(id, old, nval) {eval("this.layerRef." + id + " = '" + nval + "'");return nval;});
  this.watch("left", function(id, old, nval) {eval("this.layerRef." + id + " = '" + nval + "'"); return nval;});}
 Layer.prototype.style = new _style();} 

document.getElementById = function(name){
if(document.hostApplication == "Net"){
var lyr=eval("document." + name);lyr.style.layerRef=lyr;return lyr;
}else{return eval("document.all." + name);}}}

simon

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top