[thelist] Javascript Urg

Martyn Haigh martyn.haigh at virgincosmetics.com
Wed Jan 8 10:58:01 CST 2003


Can someone help me - I'm having some problems with javascript on
Netscape/Mozilla/Opera.

Here is what I'm doing.

I have a simple API :

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

with this I'm trying to do this :

	var x = new getObj("TitleOther");
	x.style.display = 'none';

	x = new getObj("Address");
	x.style.display = 'none';

To these

<input name="TitleOther" type="text" size="20" tabindex="1"
class="forminput20">

<input name="Address" type="text" size="20" tabindex="2"
class="forminput20">

This works fine for IE 6 - but I can't get it to work on anything else.

Can anyone fix this AND can anyone suggest some places to go where they
explain in simpleton terms how to do javascripting.

Thank you


DISCLAIMER: The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this email by
anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it, is prohibited and may be unlawful.





More information about the thelist mailing list