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

Netscape 6.0 form/reload problem

Status
Not open for further replies.

belocin

Programmer
Jul 10, 2000
12
US
I have a form that calculates and fills in the fields for subtotals, tax, and totals after the user enters an amount for a product, using onchange.
The code works fine so far in all other browsers except Netscape 6.0. In this browser, it just blanks out the fields that are automatically updated. If I hit the reload button then it shows the correct values. So seeing that I decided to test for Netscape and 5 and if it was that browser, do location.reload(true);. Well it reloaded but the form reflects as if it were reset.
But then when I manually click on the Reload button in the browser, it shows the correct results. Does anyone know what's going on with this? Is there something I did wrong when I assigned values in my code?

thanks

Here is my code in it's entirety:

function changeform(ssform)
{
var subtotalVal;
subtotalVal = 0;

var taxVal;
taxVal = 0;

var totalVal;
totalVal = 0;

var strSubtotalVal;
var strTaxVal;
var strTotalVal;

var SYC6FTtempVal;
SYC6FTtempVal = document.surestopform["SYC6FT"].value;

var SYC6FCtempVal;
SYC6FCtempVal = document.surestopform["SYC6FC"].value;

var SYC1FF2tempVal;
SYC1FF2tempVal = document.surestopform["SYC1FF2"].value;

var SYC7TA1tempVal;
SYC7TA1tempVal = document.surestopform["SYC7TA1"].value;

var SYC8T2tempVal;
SYC8T2tempVal = document.surestopform["SYC8T2"].value;

var SYC8TAC2tempVal;
SYC8TAC2tempVal = document.surestopform["SYC8TAC2"].value;

var SYC650BBtempVal;
SYC650BBtempVal = document.surestopform["SYC650BB"].value;



if ((SYC6FTtempVal == "") || (SYC6FTtempVal == " ") || (SYC6FTtempVal == " " )|| (SYC6FTtempVal == " "))
{
SYC6FTtempVal = 0;
}
else
{
if (isNaN(SYC6FTtempVal))
SYC6FTtempVal = 0;
else
SYC6FTtempVal = document.surestopform["SYC6FT"].value;
}




if ((SYC6FCtempVal == "") || (SYC6FCtempVal == " ") || (SYC6FCtempVal == " " )|| (SYC6FCtempVal == " "))
{
SYC6FCtempVal = 0;
}
else
{
if (isNaN(SYC6FCtempVal))
SYC6FCtempVal = 0;
else
SYC6FCtempVal = document.surestopform["SYC6FC"].value;
}



if ((SYC1FF2tempVal == "") || (SYC1FF2tempVal == " ") || (SYC1FF2tempVal == " " )|| (SYC1FF2tempVal == " "))
{
SYC1FF2tempVal = 0;
}
else
{
if (isNaN(SYC1FF2tempVal))
SYC1FF2tempVal = 0;
else
SYC1FF2tempVal = document.surestopform["SYC1FF2"].value;
}


if ((SYC7TA1tempVal == "") || (SYC7TA1tempVal == " ") || (SYC7TA1tempVal == " " )|| (SYC7TA1tempVal == " "))
{
SYC7TA1tempVal = 0;
}
else
{
if (isNaN(SYC7TA1tempVal))
SYC7TA1tempVal = 0;
else
SYC7TA1tempVal = document.surestopform["SYC7TA1"].value;
}


if ((SYC8T2tempVal == "") || (SYC8T2tempVal == " ") || (SYC8T2tempVal == " " )|| (SYC8T2tempVal == " "))
{
SYC8T2tempVal = 0;
}
else
{
if (isNaN(SYC8T2tempVal))
SYC8T2tempVal = 0;
else
SYC8T2tempVal = document.surestopform["SYC8T2"].value;
}


if ((SYC8TAC2tempVal == "") || (SYC8TAC2tempVal == " ") || (SYC8TAC2tempVal == " " )|| (SYC8TAC2tempVal == " "))
{
SYC8TAC2tempVal = 0;
}
else
{
if (isNaN(SYC8TAC2tempVal))
SYC8TAC2tempVal = 0;
else
SYC8TAC2tempVal = document.surestopform["SYC8TAC2"].value;
}


if ((SYC650BBtempVal == "") || (SYC650BBtempVal == " ") || (SYC650BBtempVal == " " )|| (SYC650BBtempVal == " "))
{
SYC650BBtempVal = 0;
}
else
{
if (isNaN(SYC650BBtempVal))
SYC650BBtempVal = 0;
else
SYC650BBtempVal = document.surestopform["SYC650BB"].value;
}



//alert (SYC6FTtempVal);

//alert(document.surestopform["SYC6FT"].value);
document.surestopform["SYC6FTval"].value = SYC6FTtempVal;
document.surestopform["SYC6FCval"].value = SYC6FCtempVal;
document.surestopform["SYC1FF2val"].value = SYC1FF2tempVal;
document.surestopform["SYC7TA1val"].value = SYC7TA1tempVal;
document.surestopform["SYC8T2val"].value = SYC8T2tempVal;
document.surestopform["SYC8TAC2val"].value = SYC8TAC2tempVal;
document.surestopform["SYC650BBval"].value = SYC650BBtempVal;


subtotalVal = (SYC6FTtempVal * 24.95) + (SYC6FCtempVal * 24.95) + (SYC1FF2tempVal * 21.95) + (SYC7TA1tempVal * 29.95) + (SYC8T2tempVal * 39.95) + (SYC8TAC2tempVal * 49.95) + (SYC650BBtempVal * 99.95);
//alert(subtotalVal);
subtotalVal = Math.round(subtotalVal *100)/100;


taxVal = Math.round((subtotalVal * .055)*100)/100;
totalVal = Math.round((subtotalVal + taxVal)*100)/100;



strSubtotalVal = subtotalVal + "";
strTaxVal = taxVal + "";
strTotalVal = totalVal + "";





document.surestopform["subtotal"].value = formatNum(strSubtotalVal);
document.surestopform["tax"].value = formatNum(strTaxVal);
document.surestopform["total"].value = formatNum(strTotalVal); // Math.round(totalVal*100)/100;

var brows = navigator.appName;
alert(brows);
var browsvers = navigator.appVersion;
//alert(browsvers.charAt(0));
if((navigator.appName == "Netscape") && (browsvers.charAt(0) == 5))
{
alert("it's netscape");
location.reload(true);
//document.window.reload();
}
//{ alert(browsvers.charAt(0)); }
//
}

function formatNum(tempVal)
{
var newVal;
var aft;

if(tempVal.indexOf(".") == -1)
{
newVal = tempVal + ".00";
return newVal;
}
else
{
aft = tempVal.substring(tempVal.indexOf("."),tempVal.length);
if(aft.length == 2)
{
newVal = tempVal + "0";
return newVal;
}
else
{ return tempVal; }
}
}
 
Ok I figured out the problem was with style in the input tag
style="border:0px solid #ffffff; background-color:#FFFFFF; color:#000000; font-weight:bold; text-align:right;"

when I took that out it worked.

So my question now is: How can I make the textbox border invisible, and the font for the textbox red in Netscape.
I tried using a style sheet and having class in the input tag, but that didn't work either.

thanks

ô¿ô "The check rents.
~ It does not buy."
Elvis Cole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top