I have this code I've written which works perfectly in Internet Explorer, but will not work in Netscape. I know Netscape requires better coding practices then IE, but I can't seem to figure out what's wrong with my code.
Here is my code:
-------------------------------------------------------
function TicketCost()
{
var CostPerTicket = 129;
var NumOfTickets;
var TotalCost;
var date;
NumOfTickets = Number(frmTickets.txtQuantity.value);
TotalCost = NumOfTickets * CostPerTicket;
var CostPerTicketChild = 89;
var NumOfTicketsChild;
var TotalCostChild;
NumOfTicketsChild = Number(frmTickets.txtQuantityChild.value);
TotalCostChild = NumOfTicketsChild * CostPerTicketChild;
frmTickets.txtCostTotal.value = TotalCostChild + TotalCost;
frmTickets.At_Least_1_Passenger.value = NumOfTickets + NumOfTicketsChild;
var Money = 10;
var discountPrice;
var Discount;
var subTotal;
var Passengers;
var noTax;
var Tax = 0.04166;
var withTax;
var result;
subTotal = Number(frmTickets.txtCostTotal.value);
Passengers = Number(frmTickets.At_Least_1_Passenger.value);
discountPrice = Passengers * Money;
Discount = subTotal - discountPrice;
withTax = Discount * Tax;
result=Math.round(withTax*100)/100;
PassengersM = Number(frmTickets.At_Least_1_Passenger.value);
frmTickets.txtDiscountTotal.value = Discount + result;
frmTickets.txtTaxTotal.value = result;
frmTickets.txtDiscountPrior.value = discountPrice;
}
-------------------------------------------------------
I call the code from a form where onChange and on Submit, it calls the function TicketCost(). Can anyone see what the problem is? I aprreciate the help.
Here is my code:
-------------------------------------------------------
function TicketCost()
{
var CostPerTicket = 129;
var NumOfTickets;
var TotalCost;
var date;
NumOfTickets = Number(frmTickets.txtQuantity.value);
TotalCost = NumOfTickets * CostPerTicket;
var CostPerTicketChild = 89;
var NumOfTicketsChild;
var TotalCostChild;
NumOfTicketsChild = Number(frmTickets.txtQuantityChild.value);
TotalCostChild = NumOfTicketsChild * CostPerTicketChild;
frmTickets.txtCostTotal.value = TotalCostChild + TotalCost;
frmTickets.At_Least_1_Passenger.value = NumOfTickets + NumOfTicketsChild;
var Money = 10;
var discountPrice;
var Discount;
var subTotal;
var Passengers;
var noTax;
var Tax = 0.04166;
var withTax;
var result;
subTotal = Number(frmTickets.txtCostTotal.value);
Passengers = Number(frmTickets.At_Least_1_Passenger.value);
discountPrice = Passengers * Money;
Discount = subTotal - discountPrice;
withTax = Discount * Tax;
result=Math.round(withTax*100)/100;
PassengersM = Number(frmTickets.At_Least_1_Passenger.value);
frmTickets.txtDiscountTotal.value = Discount + result;
frmTickets.txtTaxTotal.value = result;
frmTickets.txtDiscountPrior.value = discountPrice;
}
-------------------------------------------------------
I call the code from a form where onChange and on Submit, it calls the function TicketCost(). Can anyone see what the problem is? I aprreciate the help.