Forum Moderators: open

Message Too Old, No Replies

Script not working in IE

         

ravish06

3:51 am on Dec 28, 2009 (gmt 0)

10+ Year Member



Hi friends, the following code is not working in IE but its working fine in FFox, This is regarding the visibility of table when some selects the tld value.

<script language="JavaScript" type="text/javascript">
<!--

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"){extrarequired = true;}
if(tld == ".org.au"){extrarequired = true;}
if(tld == ".net.au"){extrarequired = true;}
if(tld == ".asn.au"){extrarequired = true;}
table = document.getElementById("extra");
requiredfields = document.getElementById("requiredfields");
if(extrarequired)
{
table.style.visibility="visible";
requiredfields.value = "domname,realname,email,regoname,regoabn,regoaddress,regophone";
}
else
{
table.style.visibility="collapse";
requiredfields.value = "domname,realname,email";
}
}
//-->
</script>

Can anyone please help. Many Thanks

daveVk

7:10 am on Dec 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



table.style.visibility="collapse"

collapse is not well supported maybe hidden will do ?

ravish06

10:11 am on Dec 28, 2009 (gmt 0)

10+ Year Member



Hi dave thanks for your reply and looking into this, but "hidden" dont work, can you suggest anything else, I am really fed up of this after researching so many hours on this. Thanks, ravish

daveVk

10:32 am on Dec 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try
table.style.display="block";
and
table.style.display="none";

google "Display vs Visibility" for more info

ravish06

10:13 am on Dec 31, 2009 (gmt 0)

10+ Year Member



hi dave .display="none"; is working ok in IE and now that table is invisible be default but its not responding on .display="block";
when selecting the .com.au option from code its not displaying the table.

Fotiman

3:08 pm on Dec 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Instead of table.style.display='block', try this:
table.style.display='';

That will simply remove the display:none, without setting your table to display block.

So:


if (extrarequired) {
table.style.display = "";
requiredfields.value = "domname,realname,email,regoname,regoabn,regoaddress,regophone";
}
else {
table.style.display = "none";
requiredfields.value = "domname,realname,email";
}

Note, also, that in your example, you have not declared your variables using "var", so they're going to have global scope (which is generally considered to be a bad thing).

daveVk

11:03 pm on Dec 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also check there are no remaining references to visibility in the html or css.

ravish06

5:33 am on Jan 1, 2010 (gmt 0)

10+ Year Member



Hi Fotiman and dave many thanks for looking into this. I have also tried ur recommendations .display=""; and .display="none"; I am just posting a part of my small code(sorry for my bad programming practice, keep on improving) can you please look Its working fine in mozilla, chrome but not in IE. I hate IE.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Domain Names Registrations,</title>

<script type="text/javascript">
<!--
function pageinit()
{
document.getElementById("extra").style.display="none";
}
// -->
</script>
<style type="text/css">
<!--
.style4 {font-family: "Arial Rounded MT Bold", "Arial Unicode MS";
color: #0000FF;
font-size: 18pt;}
.style5 {color: #0000FF}
.style8 {font-style: italic;
font-family: "Book Antiqua";
font-weight: bold;}
.style9 {color: #FF9933}
.style12 {color: #0000FF; font-weight: bold;}
.style14 {font-family: "Arial Rounded MT Bold", "Arial Unicode MS"}
.style17 {color: #FF9933; font-weight: bold;}
.style18 {font-weight: bold}
.style19 {font-size: 18pt;
color: #0000FF;}
.style20 {font-size: 12px}
.style21 {color: #FF0000;
font-size: 12pt;}
.style23 {color: #FF0000}
body {
background-image: url(images/pagebgrnd.png);
}
.style24 {color: #FFFFFF}
-->
</style>

<!-- form code updated -->
<script language="JavaScript" type="text/javascript">
<!--

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"){extrarequired = true;}
if(tld == ".org.au"){extrarequired = true;}
if(tld == ".net.au"){extrarequired = true;}
if(tld == ".asn.au"){extrarequired = true;}
table = document.getElementById("extra");
requiredfields = document.getElementById("requiredfields");
if(extrarequired)
{
table.style.display="";
requiredfields.value = "domname,realname,email,regoname,regoabn,regoaddress,regophone";
}
else
{
table.style.display="none";
requiredfields.value = "domname,realname,email";
}
}
// -->
</script>
</head>
<body onload="pageinit();">
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;</td>
<td colspan="5"><div align="right"><img src="banners/registerdomain.gif" width="468" height="60" /></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td rowspan="6" valign="top" width="141" background="domnames_files/gray.gif"><div align="center">
<p class="style4">&nbsp;</p>
<p class="style4">Navigation</p>
</div>

<p class="style12"><span class="style4"><img src="images/transparant.gif" width="141" height="106" /></span><br />
</p>
</div></td>
<td colspan="3" valign="top" bgcolor="#ffffff"><div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="650" height="120">
<param name="movie" value="umbrellaheader.swf" />
<param name="quality" value="high" />
<embed src="umbrellaheader.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="650" height="120"></embed>
</object>
</div></td>
<td valign="top" background="domnames_files/gray.gif">&nbsp;</td>
<td rowspan="4" valign="top" width="154" background="domnames_files/gray.gif"><div align="center">
<p class="style4">&nbsp;</p>
<p class="style4">Agents For:</p>
<p class="style4"><img src="images/seqct.gif" width="137" height="47" /></p>
<p class="style4"><img src="images/enginani1.gif" width="141" height="106" /></p>
</div></td>
</tr>
<tr>
<td colspan="3" valign="top" bgcolor="#ffffff"><div class="style19" align="center"><br />
<img src="images/ovaldomnanes.png" alt="All About Domain Names / URL's" width="347" height="93" /><br />
</div></td>
<td rowspan="2" valign="top" width="4" background="domnames_files/gray.gif">&nbsp;</td>
</tr>
<tr>
<td colspan="3" valign="top" bgcolor="#ffffff"><div align="center"><br />
<img src="photos/welcome4.jpg" width="230" height="154" /> </div></td>
</tr>
<tr>
<td colspan="3" bgcolor="#ffffff">&nbsp;</td>
<td valign="top" width="4" background="domnames_files/gray.gif">&nbsp;</td>
</tr>
<tr>
<td valign="bottom" width="10" bgcolor="#ffffff">&nbsp;</td>
<td colspan="2" valign="top" bgcolor="#ffffff"><div class="Section1">
<h1 class="style4" align="center">Managed Domain Name(s)</h1>
<p align="left"><a href="http://domains.umbrellait.com.au/">Click here to self manage your existing domain name(s)</a></p>
<p>Managing your own domain name(s) can be an arduous task for a busy person.<br />
Keeping in mind when the domain name needs to be renewed requires some pretty nifty calendaring for most.</p>
<p>And then the technical side of domain name management can be a bit of a show <span class="GramE">stopper</span>, too.</p>
<p><span class="style14"> Umbrella</span><strong> <i>i</i>.</strong><span class="style14">T</span> takes the worry out of domain name management.</p>
<p>Our extensive technical experience allows <span class="style14">Umbrella</span><strong> <i>i</i>.</strong><span class="style14">T</span> to assist quickly and comprehensively with all domain name matters.</p>
<p>For an obligation free quote please fillout the form below .</p>
<p class="MsoNormal" align="center"><a href="http://domains.umbrellait.com.au/" target="domains">Register and/or self manage your domain name here</a> </p>
<div align="center">
<table width="297" border="0" bordercolor="#000080" cellpadding="2" cellspacing="0">
<form action="http://domains.umbrellait.com.au/" method="post" name="lookup" id="lookup">
<input name="domain.tld.com" value="OK" type="hidden" />
<input name="domain.tld.net" value="OK" type="hidden" />
<input name="domain.tld.org" value="OK" type="hidden" />
<input name="domain.tld.biz" value="OK" type="hidden" />
<input name="domain.tld.info" value="OK" type="hidden" />
<input name="domain.tld.com.au" value="OK" type="hidden" />
<input name="domain.tld.net.au" value="OK" type="hidden" />
<input name="domain.tld.asn.au" value="OK" type="hidden" />
<input name="domain.tld.org.au" value="OK" type="hidden" />
<input name="domain.tld.id.au" value="OK" type="hidden" />
<input name="domain.tld.co.uk" value="OK" type="hidden" />
<input name="domain.tld.uk.com" value="OK" type="hidden" />
<input name="domain.tld.us" value="OK" type="hidden" />
<input name="domain.tld.us.com" value="OK" type="hidden" />
<input name="domain.tld.tv" value="OK" type="hidden" />
<input name="domain.tld.cc" value="OK" type="hidden" />
<tbody>
<tr bgcolor="#000080">
<td colspan="3" align="center"><b><font color="#ffffff">Self Register your Domain Name Now </font></b></td>
</tr>
<tr bgcolor="#c0c0c0">
<td class="searchFormField" width="43">www.</td>
<td class="searchFormField" width="285" nowrap="nowrap"><input name="domain.name" size="15" type="text" />
&nbsp;<b>.</b>&nbsp;
<select name="domain.tld" class="searchInput">
<option value="com" selected="selected">com</option>
<option value="net">net</option>
<option value="org">org</option>
<option value="biz">biz</option>
<option value="info">info</option>
<option value="cc">cc</option>
<option value="tv">tv</option>
<option value="us">us</option>
<option value="com.au">com.au</option>
<option value="net.au">net.au</option>
<option value="org.au">org.au</option>
<option value="id.au">id.au</option>
<option value="asn.au">asn.au</option>
</select>
&nbsp;
<input value=" Go! " class="searchButton" type="submit" />
&nbsp; </td>
<td width="0"></td>
</tr>
</tbody>
</form>
</table>
</div>
<p>Existing customers log in with the username and password you selected when you registered your domain name with us.</p>
<p><strong><span style="font-family: &quot;Arial Unicode MS&quot;,&quot;sans-serif&quot;;">Forgotten your username/password?</span></strong> Contact <a href="http://umbrellait.com.au/feedback.htm">Tech Support</a>.<br />
A new password will be generated and e-mailed to the registered e-mail address.</p>
<p><span class="GramE"><strong><span style="font-family: &quot;Arial Unicode MS&quot;,&quot;sans-serif&quot;;">Further questions or comments?</span></strong></span> Check the <a href="http://umbrellait.com.au/faq.htm">FAQ</a> or contact <a href="http://umbrellait.com.au/feedback.htm">Technical Support</a>.</p>
<p class="MsoNormal" align="left"><span class="style14">NOTE: .AU Domain Name Registration</span></p>
<strong>About auDA</strong>
<p>.au Domain Administration Ltd (auDA) is the policy authority and industry self-regulatory body for the .au domain space. </p>
<p align="left">For more information about auDa you can visit their website [auda.org.au<...]
<p align="left"><strong>auDa Regulations requiers that the following information must be provided before <em>registration</em> or <em>transfer</em> of most .AU domain names can be processed.</strong></p>
<h1 class="style4 style22" align="center"> Domain Name Required Info Form</h1>


<table border="0">
<tbody>
<tr>
<th scope="row"><div align="left">Domain Name:</div></th>
<th scope="row" width="212"><input name="domname" id="domname" size="30" type="text" /></th>
<th scope="row" width="89"><select name="tld" id=".com" onchange="selecttld(this);">
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".info">.info</option>
<option value=".org">.org</option>
<option value=".biz">.biz</option>
<option value=".asia">.asia</option>
<option value=".tv">.tv</option>
<option value=".us.com">.us.com</option>
<option value=".ca">.ca</option>
<option value=".id.au">.id.au</option>
<option value=".com.au">.com.au</option>
<option value=".org.au">.org.au</option>
<option value=".net.au">.net.au</option>
<option value=".asn.au">.asn.au</option>
<option value="Other">Other</option>
</select></th>
<th colspan="2" scope="row"><span class="style20">(to be registered or transferred)</span></th>
</tr>
<tr>
<th colspan="4" scope="row"><div align="left">Information provided by:</div></th>
<td width="159">&nbsp;</td>
</tr>
<tr valign="top">
<th scope="row" width="150"> <div align="left">Full Name:</div></th>
<td colspan="3"><label for="textfield"></label>
<input name="realname" id="name1" size="43" type="text" />
</td>
<td><span class="style21">Required</span></td>
</tr>
<tr valign="top">
<th scope="row"> <div align="left">E-mail address:</div></th>
<td colspan="3"><label for="textfield"></label>
<input name="email" id="email ad1" size="43" type="text" />
</td>
<td><span class="style21">Required</span></td>
</tr>
<tr valign="top">
<th scope="row"> <div align="left">Domain authCode:</div></th>
<td><label for="textfield"></label>
<input name="authcode" id="authcode" size="30" type="text" />
</td>
<td colspan="3"><div class="style20" align="right">
<div class="style21" align="left">Only Required for transfer!</div>
</div></td>
</tr>

</tbody>
</table>
<table width="93%" align="center" border="0">
<tbody>
<tr>
<th scope="row">&nbsp;</th>
</tr>
</tbody>
</table>
<table width="99%" border="0" id="extra">
<tbody>
<tr>
<th colspan="3" valign="top" scope="row"><span class="style23">Fields below are only required for .com.au, .net.au, .asn.au and .org.au ! </span></th>
</tr>
<tr>
<th scope="row" valign="top" width="38%"><div align="left">Organisation Type: </div></th>
<td width="25%"><label for="textfield"></label>
<label for="select"></label>
<select name="organisationtype" id="select">
<option>Please Choose</option>
<option value="PTY LTD">PTY LTD</option>
<option value="Sole Trader">Sole Trader</option>
<option value="Partner Ship">Partner Ship</option>
<option value="Family Trust">Family Trust</option>
<option value="Other">Other</option>
</select>
</td>
<td valign="top" width="37%">&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant Name:</div></th>
<td><label for="textfield"></label>
<input name="regoname" id="textfield" type="text" />
</td>
<td valign="top">(Individual or Business name) </td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant Number:</div></th>
<td><label for="textfield"></label>
<input name="regoabn" id="regomumb" type="text" />
</td>
<td valign="top">(ABN or ACN)</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant State: </div></th>
<td><select name="state" id="state">
<option>Please Choose</option>
<option value="NT">NT</option>
<option value="NSW">NSW</option>
<option value="QLD">QLD</option>
<option value="VIC">VIC</option>
<option value="WA">WA</option>
<option value="TAS">TAS</option>
</select></td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant Address: </div></th>
<td colspan="2"><label for="textfield"></label>
<input name="regoaddress" id="textfield" size="60" type="text" />
</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant Telephone: </div></th>
<td><label for="textfield"></label>
<input name="regophone" id="regophone" type="text" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Registrant Mobile: </div></th>
<td><label for="textfield"></label>
<input name="regomobile" id="regomob" type="text" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Trademark Name: </div></th>
<td><label for="textfield"></label>
<input name="trademarkname" id="trademarkname" type="text" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Trademark Number: </div></th>
<td><label for="textfield"></label>
<input name="trademarknumberb" id="trademarknmb" type="text" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row" valign="top"> <div align="left">Name of Act of Parliament: </div></th>
<td><label for="textfield"></label>
<input name="actparliament" id="actparliament" type="text" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<table width="99%" border="0">
<tbody>
<tr>
<th width="33%" scope="row"> <div align="right">Additional Comments: </div></th>
<th colspan="3" scope="row"> <label for="textarea"></label>
<div align="left">
<textarea name="comments" cols="40" id="textarea" onfocus="blank(this);">Replace this text with your comments / questions</textarea>
</div></th>
</tr>
<tr>
<th colspan="4" scope="row"> <div align="left">Note: Before a registration or transfer can be processed, all relevant documentation must be forwarded to <span class="style14">Umbrella</span><strong> <i>i</i>.</strong><span class="style14">T</span></div></th>
</tr>
<tr>
<th colspan="2" scope="row">&nbsp;</th>
<td width="12%">&nbsp;</td>
<td width="11%">&nbsp;</td>
</tr>
</tbody>
</table>
<table width="100%" border="0">
<tbody>
<tr> <!-- for captcha-->
<td div align="right"><img src="captcha.php" alt="captcha image"></td><td><input type="text" div align =" right" name="captcha" size="3" maxlength="3">
</td>
</tr>
<tr>
<th scope="row" width="48%"> <label for="Submit"></label>
<div align="right">

<!-- <input name="Submit" value="Submit" id="Submit" type="submit" /> -->
</div></th>
<td width="52%"><label for="Submit"></label>
<input name="send" id="send" style="float: left;" value="SUBMIT ENQUIRY" type="submit" />
<input name="Reset" value="Reset" id="Submit" type="reset" />
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0">
<tbody>
<tr>
<th scope="row">&nbsp;</th>
</tr>
</tbody>
</table>
</form>
</div></td>
<td valign="top" background="domnames_files/gray.gif">&nbsp;</td>
<td valign="top" width="154" background="domnames_files/gray.gif">&nbsp;</td>
</tr>
<tr>
<td valign="bottom" width="10" bgcolor="#ffffff">&nbsp;</td>
<td valign="bottom" width="240" bgcolor="#ffffff"><p align="left"><span class="style5"><img src="images/support.gif" width="134" height="61" /><a href="ssl.htm"><img src="images/siteseal.gif" alt="This page is send using our Secure Server" width="100" height="60" border="0" /></a></span></p></td>
<td valign="top" width="4" background="domnames_files/gray.gif">&nbsp;</td>
<td valign="middle" width="154" background="domnames_files/gray.gif">&nbsp;</td>
</tr>
</tbody>
</table>
</body>
</html>

ravish06

8:23 am on Jan 1, 2010 (gmt 0)

10+ Year Member



Hi guys ohh its working now ! I have tried in IE 6 and its works good as per my needs. Many thanks for ur support.