DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
Java
IT Tags

JS not working in IE-help needed

By: rekha singh | 12 May 2010 1:53 pm

 Hi friends,

 
I have written a small code regarding the visibility of table but its working fine fine in firefox and do not work in IE. The code is
 
<script language="JavaScrip t" type="text/javascri pt">
<!--
 
function copyfields(elem)
{
elem.name.value = elem.realname. value;
elem.email_address. value = elem.email.value;
return TRUE;
}
 
function blank(elem)
{
if(elem.value == 'Replace this text with your comments / questions')
{
elem.value = '';
}
}
 
function selecttld(elem)
{
extrarequired = false;
tld = elem.value;
if(tld == ".com.au"){extrareq uired = true;}
if(tld == ".org.au"){extrareq uired = true;}
if(tld == ".net.au"){extrareq uired = true;}
if(tld == ".asn.au"){extrareq uired = true;}
table = document.getElement ById("extra" );
requiredfields = document.getElement ById("requiredfi elds");
if(extrarequired)
{
table.style. visibility= "visible" ;
requiredfields. value = "domname,realname, email,regoname, regoabn,regoaddr ess,regophone" ;
}
else
{
table.style. visibility= "collapse" ;
requiredfields. value = "domname,realname, email";
}
}
//-->
</script>
 
Can anyone pls help......
 

Comments

try using.. style.display = "none"; for invisible

and style.display = ""; for visible
 
good luck
 
By: rekha singh | 12 May 2010

Use "*h**idden*" instead of "*collapse*" .... No version of IE is supported visibility property as "collapse" or "inherit"

Reference: http://www.w3school s.com/CSS/ pr_class_ visibility. asp

<http://www.w3school s.com/CSS/ pr_class_ visibility. asp>Thanks
 

By: rekha singh | 12 May 2010

Hi  many thanks for ur reply but hidden dont work in mozilla u know because it uses the space after making the table invisible. 

By: rekha singh | 12 May 2010

i told you to use style.display = 'none'; for invisible and style.display = '' for visible 

By: rekha singh | 12 May 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move