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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text boxes disappear

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Hi all

I am having an incredibly strange problem...I have recently been messing around with a form page (scripting, I actually posted about it earlier: how to submit a form using the neter key when you have no <input type=&quot;submit&quot;> button). All of a sudden the text boxes disappeared in Netscape. They still appear in IE though. The kicker is that I didn't change anything to do with the text input areas...Weird.

Ben
 
Can you show us the coding, would make life easier! DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
I could, but it's probably just a stupid problem. I was just sharing what was going on. If I can't get it soon, I'' definitely post it. As I look at it now, I'm thinking maybe it's a nesting problem...
 
The form tags must be present in Netscape (except ver 6 I think) or the elements will disapear. If you arent using the form to submit at all you can try something like this (haven't tested it, just an idea):

<form onsubmit=&quot;return false&quot;> jared@aauser.com
 
Alright, here it is...I can't figure it out.

This contains a REALLY messy solution to the submitting with an enter button problem. I tried to use a hidden submit button to do it (see earlier postings), but it didn't seem to work when the button was hidden, so I resorted to putting the submit button way down in the page, where no one will see it. Anyway, here's the code:

<body bgcolor=&quot;#FFFFFF&quot; onload=&quot;redirectPage(); defaultStatus='Welcome to Acarta!';MM_preloadImages('images/buttons/startdemo_over.gif')&quot; background=&quot;images/background.gif&quot;>
<form name=&quot;login&quot; method=&quot;post&quot; action=&quot;asp/Authenticate_demo1.asp&quot;>
<div style=&quot;position: absolute; left: 0; top: 0; right: 0; visibility:visible; width: 760; height: 69&quot;>
<table width=&quot;760&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;navbar&quot;>

<tr>
<td width=&quot;173&quot; height=&quot;69&quot;><img src=&quot;images/toplogo.gif&quot; width=&quot;173&quot; height=&quot;69&quot; usemap=&quot;#Map&quot; border=&quot;0&quot;><map name=&quot;Map&quot;><area shape=&quot;rect&quot; coords=&quot;37,5,164,65&quot; href=&quot;asp/intro.asp&quot; alt=&quot;Back to Intro&quot; title=&quot;Back to Intro&quot;></map></td>
<td width=&quot;362&quot; height=&quot;69&quot;>
<div align=&quot;center&quot;><img src=&quot;images/topnavbar.gif&quot; width=&quot;362&quot; height=69></div>
</td>
<td width=&quot;225&quot; height=&quot;69&quot;>
<div align=&quot;right&quot;><img src=&quot;images/topright.gif&quot; width=&quot;225&quot; height=&quot;69&quot;></div>
</td>
</tr>
</table>
</div>
<br>
<br>
<p><br>
<br>
</p>
<table width=&quot;760&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;40&quot;><img src=&quot;transparent.gif&quot; width=&quot;40&quot; height=&quot;1&quot;></td>
<td width=&quot;723&quot;>
<table align=&quot;left&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;635&quot;>
<tr>
<td height=&quot;282&quot; valign=&quot;top&quot;>
<h1 align=&quot;center&quot;>Welcome to Acarta!</h1>
<p align=&quot;left&quot;>blablabla</p>
<p align=&quot;left&quot;>blablabla.</p>
<p align=&quot;left&quot;>To begin:</p>
<ul>
<li>Enter the Card Number (last 8 digits) and PIN supplied in your
Introductory Package.</li>
<li>Press Start.</li>
</ul>

<table width=&quot;60%&quot; border=&quot;0&quot; align=&quot;center&quot;>
<tr>
<td height=&quot;25&quot; width=&quot;67%&quot;>
<div align=&quot;right&quot;>Card Number (last 8 digits only):</div>
</td>
<td height=&quot;25&quot; width=&quot;33%&quot;>
<input type=&quot;text&quot; name=&quot;Cardnum&quot; size=&quot;8&quot; maxlength=&quot;8&quot;>
</td>
</tr>
<tr>
<td width=&quot;67%&quot;>
<div align=&quot;right&quot;>PIN Number:</div>
</td>
<td width=&quot;33%&quot;>
<input type=&quot;password&quot; name=&quot;PIN&quot; size=&quot;4&quot; maxlength=&quot;4&quot;>
</td>
</tr>
<tr>
<td>

</td>
</tr>
</table>
<p align=&quot;center&quot;><a href=&quot;javascript:validate2()&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('begin_button','','images/buttons/startdemo_over.gif',1)&quot;>
<img src=&quot;images/buttons/startdemo.gif&quot; width=&quot;100&quot; height=&quot;44&quot; name=&quot;begin_button&quot; border=&quot;0&quot; align=&quot;middle&quot; alt=&quot;Click Here to Begin&quot;>
</a> </p>

<p align=&quot;center&quot;><font size=&quot;-3&quot;>(No Card Number and PIN? <a href=&quot;signup.htm&quot;>Click
here</a>.)</font></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>  </p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><br>
<br>
<br><br>
<br><br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br>
<br><br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br>
<input type=&quot;submit&quot; onClick=&quot;validate()&quot; value=&quot;_&quot;>
</form>
</body>
</html>
 
post the head of your document also, maybe I'll see what's wrong with it jared@aauser.com
 
<head>
<title>Acarta - Your Card for Customer Loyalty</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; href=&quot;demo.css&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function redirectPage() {
if ((screen.width == 640) &amp;&amp; (screen.height == 480))
alert(&quot;This site is best viewed with a screen resolution of 800x600 or higher&quot;);
}

function validate()
{
if (document.login.Cardnum.value ==&quot;&quot;)
{
alert(&quot;Please input your card number.&quot;);
return;
}
else if (document.login.PIN.value ==&quot;&quot;)
{
alert(&quot;Please input your PIN number.&quot;);
return;
}
}

function validate2()
{
if (document.login.Cardnum.value ==&quot;&quot;)
{
alert(&quot;Please input your card number.&quot;);
return;
}
else if (document.login.PIN.value ==&quot;&quot;)
{
alert(&quot;Please input your PIN number.&quot;);
return;
}
document.login.submit();
}

function preloadimages() { //v3.0
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadimages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.p[j]=new Image; d.p[j++].src=a;}}
}

function swapImgRestore() { //v3.0
var i,x,a=document.sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=findObj(n,d.layers.document); return x;
}

function swapimage() { //v3.0
var i,j=0,x,a=swapimage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
 
the TGML probably messed that up-try unchecking the process TGML and Emoticons thingies jared@aauser.com
 
Sorry Jared...

<head>
<title>Acarta - Your Card for Customer Loyalty</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; href=&quot;demo.css&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function redirectPage() {
if ((screen.width == 640) &amp;&amp; (screen.height == 480))
alert(&quot;This site is best viewed with a screen resolution of 800x600 or higher&quot;);
}

function validate()
{
if (document.login.Cardnum.value ==&quot;&quot;)
{
alert(&quot;Please input your card number.&quot;);
return;
}
else if (document.login.PIN.value ==&quot;&quot;)
{
alert(&quot;Please input your PIN number.&quot;);
return;
}
}

function validate2()
{
if (document.login.Cardnum.value ==&quot;&quot;)
{
alert(&quot;Please input your card number.&quot;);
return;
}
else if (document.login.PIN.value ==&quot;&quot;)
{
alert(&quot;Please input your PIN number.&quot;);
return;
}
document.login.submit();
}

function preloadimages() { //v3.0
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadimages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.p[j]=new Image; d.p[j++].src=a;}}
}

function swapImgRestore() { //v3.0
var i,x,a=document.sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=findObj(n,d.layers.document); return x;
}

function swapimage() { //v3.0
var i,j=0,x,a=swapimage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
 
this works, i too out validate1 and the onclick validate:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<html>
<head>
<title>Acarta - Your Card for Customer Loyalty</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; href=&quot;demo.css&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function redirectPage() {
if ((screen.width == 640) &amp;&amp; (screen.height == 480))
alert(&quot;This site is best viewed with a screen resolution of 800x600 or higher&quot;);
}

function validate2()
{
if (document.login.Cardnum.value ==&quot;&quot;)
{
alert(&quot;Please input your card number.&quot;);
return false;
}
else if (document.login.PIN.value ==&quot;&quot;)
{
alert(&quot;Please input your PIN number.&quot;);
return false;
}
document.login.submit();
}

function preloadimages() { //v3.0
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadimages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.p[j]=new Image; d.p[j++].src=a;}}
}

function swapImgRestore() { //v3.0
var i,x,a=document.sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=findObj(n,d.layers.document); return x;
}

function swapimage() { //v3.0
var i,j=0,x,a=swapimage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; onload=&quot;redirectPage(); defaultStatus='Welcome to Acarta!';MM_preloadImages('images/buttons/startdemo_over.gif')&quot; background=&quot;images/background.gif&quot;>
<form name=&quot;login&quot; method=&quot;post&quot; onsubmit=&quot;return validate2()&quot; action=&quot;asp/Authenticate_demo1.asp&quot;>
<div style=&quot;position: absolute; left: 0; top: 0; right: 0; visibility:visible; width: 760; height: 69&quot;>
<table width=&quot;760&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;navbar&quot;>

<tr>
<td width=&quot;173&quot; height=&quot;69&quot;><img src=&quot;images/toplogo.gif&quot; width=&quot;173&quot; height=&quot;69&quot; usemap=&quot;#Map&quot; border=&quot;0&quot;><map name=&quot;Map&quot;><area shape=&quot;rect&quot; coords=&quot;37,5,164,65&quot; href=&quot;asp/intro.asp&quot; alt=&quot;Back to Intro&quot; title=&quot;Back to Intro&quot;></map></td>
<td width=&quot;362&quot; height=&quot;69&quot;>
<div align=&quot;center&quot;><img src=&quot;images/topnavbar.gif&quot; width=&quot;362&quot; height=69></div>
</td>
<td width=&quot;225&quot; height=&quot;69&quot;>
<div align=&quot;right&quot;><img src=&quot;images/topright.gif&quot; width=&quot;225&quot; height=&quot;69&quot;></div>
</td>
</tr>
</table>
</div>
<br>
<br>
<p><br>
<br>
</p>
<table width=&quot;760&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;40&quot;><img src=&quot;transparent.gif&quot; width=&quot;40&quot; height=&quot;1&quot;></td>
<td width=&quot;723&quot;>
<table align=&quot;left&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;635&quot;>
<tr>
<td height=&quot;282&quot; valign=&quot;top&quot;>
<h1 align=&quot;center&quot;>Welcome to Acarta!</h1>
<p align=&quot;left&quot;>blablabla</p>
<p align=&quot;left&quot;>blablabla.</p>
<p align=&quot;left&quot;>To begin:</p>
<ul>
<li>Enter the Card Number (last 8 digits) and PIN supplied in your
Introductory Package.</li>
<li>Press Start.</li>
</ul>

<table width=&quot;60%&quot; border=&quot;0&quot; align=&quot;center&quot;>
<tr>
<td height=&quot;25&quot; width=&quot;67%&quot;>
<div align=&quot;right&quot;>Card Number (last 8 digits only):</div>
</td>
<td height=&quot;25&quot; width=&quot;33%&quot;>
<input type=&quot;text&quot; name=&quot;Cardnum&quot; size=&quot;8&quot; maxlength=&quot;8&quot;>
</td>
</tr>
<tr>
<td width=&quot;67%&quot;>
<div align=&quot;right&quot;>PIN Number:</div>
</td>
<td width=&quot;33%&quot;>
<input type=&quot;password&quot; name=&quot;PIN&quot; size=&quot;4&quot; maxlength=&quot;4&quot;>
</td>
</tr>
<tr>
<td>

</td>
</tr>
</table>
<p align=&quot;center&quot;><a href=&quot;javascript:validate2()&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('begin_button','','images/buttons/startdemo_over.gif',1)&quot;>
<img src=&quot;images/buttons/startdemo.gif&quot; width=&quot;100&quot; height=&quot;44&quot; name=&quot;begin_button&quot; border=&quot;0&quot; align=&quot;middle&quot; alt=&quot;Click Here to Begin&quot;>
</a> </p>

<p align=&quot;center&quot;><font size=&quot;-3&quot;>(No Card Number and PIN? <a href=&quot;signup.htm&quot;>Click
here</a>.)</font></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><br>
<br>
<br><br>
<br><br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br>
<br><br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br>
<input type=&quot;submit&quot; value=&quot;_&quot;>
</form>
</body>
</html> jared@aauser.com
 
Thanks Jared.

Any ideas why those were causing a problem?

Ben
 
what is the error you are getting? you were returning true, thats why they didn't work jared@aauser.com
 
I'm not getting an error, the text boxes just aren't there (I cut and paste your version exactly...). Note, it is working in IE, but not Netscape.

Thanks for all your help! :)

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top