R
Rick
This script works with IE but not Netscape anyone know what I am doing
wrong? If so could you help me out I am at a lost?
Thanks in advance.
The error is as follow
Error: pen0 has no properties
Line: 73
function GetPrice(){
var pen0, smartview0, smartview1, smartview2, cashscan0, cashscan1,
cashscan2, cashscan3, cashscan4, MSB0, MSB1, penv, pen2v, pen3v, pen4v,
pen5v, pen6v, pen7v, pen8v, pen9v, MSB0v, MSB1v, total, price, price1;
if (document.getElementById) {
price = document.getElementById('price');
price1 = document.getElementById('price1');
pen0 = document.getElementById('pen0');
smartview0 = document.getElementById('smartview0');
smartview1 = document.getElementById('smartview1');
smartview2 = document.getElementById('smartview2');
cashscan0 = document.getElementById('cashscan0');
cashscan1 = document.getElementById('cashscan1');
cashscan2 = document.getElementById('cashscan2');
cashscan3 = document.getElementById('cashscan3');
cashscan4 = document.getElementById('cashscan4');
MSB0 = document.getElementById('MSB0');
MSB1 = document.getElementById('MSB1');
pen0v = document.getElementById('pen0v');
smartview0v = document.getElementById('smartview0v');
smartview1v = document.getElementById('smartview1v');
smartview2v = document.getElementById('smartview2v');
cashscan0v = document.getElementById('cashscan0v');
cashscan1v = document.getElementById('cashscan1v');
cashscan2v = document.getElementById('cashscan2v');
cashscan3v = document.getElementById('cashscan3v');
cashscan4v = document.getElementById('cashscan4v');
MSB0v = document.getElementById('MSB0v');
MSB1v = document.getElementById('MSB1v');
total = document.getElementById('total');
}
else {
PurchasePen = document.PurchasePen;
price = PurchasePen.price;
price1 = PurchasePen.price1;
pen0 = PurchasePen.pen[0];
smartview0 = PurchasePen.smartview[0];
smartview1 = PurchasePen.smartview[1];
smartview2 = PurchasePen.smartview[2];
cashscan0 = PurchasePen.cashscan[0];
cashscan1 = PurchasePen.cashscan[1];
cashscan2 = PurchasePen.cashscan[2];
cashscan3 = PurchasePen.cashscan[3];
cashscan4 = PurchasePen.cashscan[4];
MSB0 = PurchasePen.MSB[0];
MSB1 = PurchasePen.MSB[1];
pen0v = PurchasePen.pen0v;
smartview0v = PurchasePen.smartview0v;
smartview1v = PurchasePen.smartview1v;
smartview2v = PurchasePen.smartview2v;
cashscan0v = PurchasePen.cashscan0v;
cashscan1v = PurchasePen.cashscan1v;
cashscan2v = PurchasePen.cashscan2v;
cashscan3v = PurchasePen.cashscan3v;
cashscan4v = PurchasePen.cashscan4v;
MSB0v = PurchasePen.MSB0v;
MSB1v = PurchasePen.MSB1v;
total = PurchasePen.total;
}
{
pen0v = 0;
smartview0v = 0;
smartview1v = 0;
smartview2v = 0;
cashscan0v = 0;
cashscan1v = 0;
cashscan2v = 0;
cashscan3v = 0;
cashscan4v = 0;
MSB0v = 0;
MSB1v = 0;
total = 0;
}
if (pen0.value == "") {
// Do Nothing
}
else if (pen0.value < 3) {
alert("There is a minimum purchase of 3 pens")
pen0.value = ""}
else if (pen0.value = 3) {
pen0v = (pen0.value * 7.95)}
else if (pen0.value > 3 && pen0.value < 11) {
pen0v = (pen0.value * 6.95)}
else if (pen0.value > 10 && pen0.value < 24) {
pen0v = (pen0.value * 5.95)}
else if (pen0.value > 23) {
pen0v = (pen0.value * 4.98)}
if (smartview0.value < 5) {
smartview0v = (smartview0.value * 34.95 )}
else if (smartview0.value > 4) {
smartview0v = (smartview0.value * 31.45 )}
{smartview2v = (smartview2.value * 30.00 )}
if (cashscan0.value < 3) {
cashscan0v = (cashscan0.value * 250.00)}
else if (cashscan0.value > 2 && cashscan0.value < 6) {
cashscan0v = (cashscan0.value * 225.00 )}
else if (cashscan0.value > 5) {
cashscan0v = (cashscan0.value * 205.00 )}
if (cashscan1.value < 3) {
cashscan1v = (cashscan1.value * 595.00)}
else if (cashscan1.value > 2 && cashscan1.value < 6) {
cashscan1v = (cashscan1.value * 525.00 )}
else if (cashscan1.value > 5) {
cashscan1v = (cashscan1.value * 495.00 )}
if (cashscan2.value < 3) {
cashscan2v = (cashscan2.value * 1750.00)}
else if (cashscan2.value > 2 && cashscan2.value < 6) {
cashscan2v = (cashscan2.value * 1650.00 )}
else if (cashscan2.value > 5) {
cashscan2v = (cashscan2.value * 1500.00 )}
if (cashscan3.value < 3) {
cashscan3v = (cashscan3.value * 995.00)}
else if (cashscan3.value > 2 && cashscan3.value < 6) {
cashscan3v = (cashscan3.value * 900.00 )}
else if (cashscan3.value > 5) {
cashscan3v = (cashscan3.value * 815.00 )}
if (cashscan4.value < 3) {
cashscan4v = (cashscan4.value * 795.00)}
else if (cashscan4.value > 2 && cashscan4.value < 6) {
cashscan4v = (cashscan4.value * 705.00 )}
else if (cashscan4.value > 5) {
cashscan4v = (cashscan4.value * 650.00 )}
if (MSB0.value < 3) {
MSB0v = (MSB0.value * 795.00)}
else if (MSB0.value > 2 && MSB0.value < 6) {
MSB0v = (MSB0.value * 705.00 )}
else if (MSB0.value > 5) {
MSB0v = (MSB0.value * 650.00 )}
if (MSB1.value < 3) {
MSB1v = (MSB1.value * 950.00)}
else if (MSB1.value > 2 && MSB1.value < 6) {
MSB1v = (MSB1.value * 900.00 )}
else if (MSB1.value > 5) {
MSB1v = (MSB1.value * 850.00 )}
{total = (pen0v + smartview0v + smartview1v + smartview2v + cashscan0v +
cashscan1v + cashscan2v + cashscan3v + cashscan4v + MSB0v + MSB1v)}
{
price.value = total.toFixed(2)
price1.value = total.toFixed(2)
}
}
wrong? If so could you help me out I am at a lost?
Thanks in advance.
The error is as follow
Error: pen0 has no properties
Line: 73
function GetPrice(){
var pen0, smartview0, smartview1, smartview2, cashscan0, cashscan1,
cashscan2, cashscan3, cashscan4, MSB0, MSB1, penv, pen2v, pen3v, pen4v,
pen5v, pen6v, pen7v, pen8v, pen9v, MSB0v, MSB1v, total, price, price1;
if (document.getElementById) {
price = document.getElementById('price');
price1 = document.getElementById('price1');
pen0 = document.getElementById('pen0');
smartview0 = document.getElementById('smartview0');
smartview1 = document.getElementById('smartview1');
smartview2 = document.getElementById('smartview2');
cashscan0 = document.getElementById('cashscan0');
cashscan1 = document.getElementById('cashscan1');
cashscan2 = document.getElementById('cashscan2');
cashscan3 = document.getElementById('cashscan3');
cashscan4 = document.getElementById('cashscan4');
MSB0 = document.getElementById('MSB0');
MSB1 = document.getElementById('MSB1');
pen0v = document.getElementById('pen0v');
smartview0v = document.getElementById('smartview0v');
smartview1v = document.getElementById('smartview1v');
smartview2v = document.getElementById('smartview2v');
cashscan0v = document.getElementById('cashscan0v');
cashscan1v = document.getElementById('cashscan1v');
cashscan2v = document.getElementById('cashscan2v');
cashscan3v = document.getElementById('cashscan3v');
cashscan4v = document.getElementById('cashscan4v');
MSB0v = document.getElementById('MSB0v');
MSB1v = document.getElementById('MSB1v');
total = document.getElementById('total');
}
else {
PurchasePen = document.PurchasePen;
price = PurchasePen.price;
price1 = PurchasePen.price1;
pen0 = PurchasePen.pen[0];
smartview0 = PurchasePen.smartview[0];
smartview1 = PurchasePen.smartview[1];
smartview2 = PurchasePen.smartview[2];
cashscan0 = PurchasePen.cashscan[0];
cashscan1 = PurchasePen.cashscan[1];
cashscan2 = PurchasePen.cashscan[2];
cashscan3 = PurchasePen.cashscan[3];
cashscan4 = PurchasePen.cashscan[4];
MSB0 = PurchasePen.MSB[0];
MSB1 = PurchasePen.MSB[1];
pen0v = PurchasePen.pen0v;
smartview0v = PurchasePen.smartview0v;
smartview1v = PurchasePen.smartview1v;
smartview2v = PurchasePen.smartview2v;
cashscan0v = PurchasePen.cashscan0v;
cashscan1v = PurchasePen.cashscan1v;
cashscan2v = PurchasePen.cashscan2v;
cashscan3v = PurchasePen.cashscan3v;
cashscan4v = PurchasePen.cashscan4v;
MSB0v = PurchasePen.MSB0v;
MSB1v = PurchasePen.MSB1v;
total = PurchasePen.total;
}
{
pen0v = 0;
smartview0v = 0;
smartview1v = 0;
smartview2v = 0;
cashscan0v = 0;
cashscan1v = 0;
cashscan2v = 0;
cashscan3v = 0;
cashscan4v = 0;
MSB0v = 0;
MSB1v = 0;
total = 0;
}
if (pen0.value == "") {
// Do Nothing
}
else if (pen0.value < 3) {
alert("There is a minimum purchase of 3 pens")
pen0.value = ""}
else if (pen0.value = 3) {
pen0v = (pen0.value * 7.95)}
else if (pen0.value > 3 && pen0.value < 11) {
pen0v = (pen0.value * 6.95)}
else if (pen0.value > 10 && pen0.value < 24) {
pen0v = (pen0.value * 5.95)}
else if (pen0.value > 23) {
pen0v = (pen0.value * 4.98)}
if (smartview0.value < 5) {
smartview0v = (smartview0.value * 34.95 )}
else if (smartview0.value > 4) {
smartview0v = (smartview0.value * 31.45 )}
{smartview2v = (smartview2.value * 30.00 )}
if (cashscan0.value < 3) {
cashscan0v = (cashscan0.value * 250.00)}
else if (cashscan0.value > 2 && cashscan0.value < 6) {
cashscan0v = (cashscan0.value * 225.00 )}
else if (cashscan0.value > 5) {
cashscan0v = (cashscan0.value * 205.00 )}
if (cashscan1.value < 3) {
cashscan1v = (cashscan1.value * 595.00)}
else if (cashscan1.value > 2 && cashscan1.value < 6) {
cashscan1v = (cashscan1.value * 525.00 )}
else if (cashscan1.value > 5) {
cashscan1v = (cashscan1.value * 495.00 )}
if (cashscan2.value < 3) {
cashscan2v = (cashscan2.value * 1750.00)}
else if (cashscan2.value > 2 && cashscan2.value < 6) {
cashscan2v = (cashscan2.value * 1650.00 )}
else if (cashscan2.value > 5) {
cashscan2v = (cashscan2.value * 1500.00 )}
if (cashscan3.value < 3) {
cashscan3v = (cashscan3.value * 995.00)}
else if (cashscan3.value > 2 && cashscan3.value < 6) {
cashscan3v = (cashscan3.value * 900.00 )}
else if (cashscan3.value > 5) {
cashscan3v = (cashscan3.value * 815.00 )}
if (cashscan4.value < 3) {
cashscan4v = (cashscan4.value * 795.00)}
else if (cashscan4.value > 2 && cashscan4.value < 6) {
cashscan4v = (cashscan4.value * 705.00 )}
else if (cashscan4.value > 5) {
cashscan4v = (cashscan4.value * 650.00 )}
if (MSB0.value < 3) {
MSB0v = (MSB0.value * 795.00)}
else if (MSB0.value > 2 && MSB0.value < 6) {
MSB0v = (MSB0.value * 705.00 )}
else if (MSB0.value > 5) {
MSB0v = (MSB0.value * 650.00 )}
if (MSB1.value < 3) {
MSB1v = (MSB1.value * 950.00)}
else if (MSB1.value > 2 && MSB1.value < 6) {
MSB1v = (MSB1.value * 900.00 )}
else if (MSB1.value > 5) {
MSB1v = (MSB1.value * 850.00 )}
{total = (pen0v + smartview0v + smartview1v + smartview2v + cashscan0v +
cashscan1v + cashscan2v + cashscan3v + cashscan4v + MSB0v + MSB1v)}
{
price.value = total.toFixed(2)
price1.value = total.toFixed(2)
}
}