473,699 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Works in IE but ont Netscape

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.getEl ementById) {
price = document.getEle mentById('price ');
price1 = document.getEle mentById('price 1');
pen0 = document.getEle mentById('pen0' );
smartview0 = document.getEle mentById('smart view0');
smartview1 = document.getEle mentById('smart view1');
smartview2 = document.getEle mentById('smart view2');
cashscan0 = document.getEle mentById('cashs can0');
cashscan1 = document.getEle mentById('cashs can1');
cashscan2 = document.getEle mentById('cashs can2');
cashscan3 = document.getEle mentById('cashs can3');
cashscan4 = document.getEle mentById('cashs can4');
MSB0 = document.getEle mentById('MSB0' );
MSB1 = document.getEle mentById('MSB1' );
pen0v = document.getEle mentById('pen0v ');
smartview0v = document.getEle mentById('smart view0v');
smartview1v = document.getEle mentById('smart view1v');
smartview2v = document.getEle mentById('smart view2v');
cashscan0v = document.getEle mentById('cashs can0v');
cashscan1v = document.getEle mentById('cashs can1v');
cashscan2v = document.getEle mentById('cashs can2v');
cashscan3v = document.getEle mentById('cashs can3v');
cashscan4v = document.getEle mentById('cashs can4v');
MSB0v = document.getEle mentById('MSB0v ');
MSB1v = document.getEle mentById('MSB1v ');
total = document.getEle mentById('total ');
}
else {
PurchasePen = document.Purcha sePen;
price = PurchasePen.pri ce;
price1 = PurchasePen.pri ce1;
pen0 = PurchasePen.pen[0];
smartview0 = PurchasePen.sma rtview[0];
smartview1 = PurchasePen.sma rtview[1];
smartview2 = PurchasePen.sma rtview[2];
cashscan0 = PurchasePen.cas hscan[0];
cashscan1 = PurchasePen.cas hscan[1];
cashscan2 = PurchasePen.cas hscan[2];
cashscan3 = PurchasePen.cas hscan[3];
cashscan4 = PurchasePen.cas hscan[4];
MSB0 = PurchasePen.MSB[0];
MSB1 = PurchasePen.MSB[1];
pen0v = PurchasePen.pen 0v;
smartview0v = PurchasePen.sma rtview0v;
smartview1v = PurchasePen.sma rtview1v;
smartview2v = PurchasePen.sma rtview2v;
cashscan0v = PurchasePen.cas hscan0v;
cashscan1v = PurchasePen.cas hscan1v;
cashscan2v = PurchasePen.cas hscan2v;
cashscan3v = PurchasePen.cas hscan3v;
cashscan4v = PurchasePen.cas hscan4v;
MSB0v = PurchasePen.MSB 0v;
MSB1v = PurchasePen.MSB 1v;
total = PurchasePen.tot al;
}
{
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.val ue < 5) {
smartview0v = (smartview0.val ue * 34.95 )}
else if (smartview0.val ue > 4) {
smartview0v = (smartview0.val ue * 31.45 )}

{smartview2v = (smartview2.val ue * 30.00 )}

if (cashscan0.valu e < 3) {
cashscan0v = (cashscan0.valu e * 250.00)}
else if (cashscan0.valu e > 2 && cashscan0.value < 6) {
cashscan0v = (cashscan0.valu e * 225.00 )}
else if (cashscan0.valu e > 5) {
cashscan0v = (cashscan0.valu e * 205.00 )}

if (cashscan1.valu e < 3) {
cashscan1v = (cashscan1.valu e * 595.00)}
else if (cashscan1.valu e > 2 && cashscan1.value < 6) {
cashscan1v = (cashscan1.valu e * 525.00 )}
else if (cashscan1.valu e > 5) {
cashscan1v = (cashscan1.valu e * 495.00 )}

if (cashscan2.valu e < 3) {
cashscan2v = (cashscan2.valu e * 1750.00)}
else if (cashscan2.valu e > 2 && cashscan2.value < 6) {
cashscan2v = (cashscan2.valu e * 1650.00 )}
else if (cashscan2.valu e > 5) {
cashscan2v = (cashscan2.valu e * 1500.00 )}

if (cashscan3.valu e < 3) {
cashscan3v = (cashscan3.valu e * 995.00)}
else if (cashscan3.valu e > 2 && cashscan3.value < 6) {
cashscan3v = (cashscan3.valu e * 900.00 )}
else if (cashscan3.valu e > 5) {
cashscan3v = (cashscan3.valu e * 815.00 )}

if (cashscan4.valu e < 3) {
cashscan4v = (cashscan4.valu e * 795.00)}
else if (cashscan4.valu e > 2 && cashscan4.value < 6) {
cashscan4v = (cashscan4.valu e * 705.00 )}
else if (cashscan4.valu e > 5) {
cashscan4v = (cashscan4.valu e * 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 )
}

}
Jul 23 '05 #1
7 1124
Ivo
"Rick" wrote
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.getEl ementById) {
price = document.getEle mentById('price ');
price1 = document.getEle mentById('price 1');
pen0 = document.getEle mentById('pen0' );

<snip endless code>

Apparently there is no element with id "pen0". For further assistance, an
URL would probably be more helpful than more code. It 's hard to tell which
line is 73 and when the error occurs. What browsers are you testing in?
--Iv
Jul 23 '05 #2
"Ivo" <no@thank.you > wrote in message
news:41******** ************@ne ws.wanadoo.nl.. .

Apparently there is no element with id "pen0". For further assistance, an
URL would probably be more helpful than more code. It 's hard to tell which line is 73 and when the error occurs. What browsers are you testing in?
--Iv

Thanks for your reply!!!

http://208.247.35.233/orderForm.html
Jul 23 '05 #3
pan

"Rick" <ri**@di-wave.com> wrote in message
news:RX******** *********@twist er.socal.rr.com ...
"Ivo" <no@thank.you > wrote in message
news:41******** ************@ne ws.wanadoo.nl.. .

Apparently there is no element with id "pen0". For further assistance, an URL would probably be more helpful than more code. It 's hard to tell

which
line is 73 and when the error occurs. What browsers are you testing in?
--Iv

Thanks for your reply!!!

http://208.247.35.233/orderForm.html

What Ivo said - you have name="pen0" but no id="pen0"

simple fix
Jul 23 '05 #4
Lee
Rick said:

"Ivo" <no@thank.you > wrote in message
news:41******* *************@n ews.wanadoo.nl. ..

Apparently there is no element with id "pen0". For further assistance, an
URL would probably be more helpful than more code. It 's hard to tell

which
line is 73 and when the error occurs. What browsers are you testing in?
--Iv

Thanks for your reply!!!

http://208.247.35.233/orderForm.html


As Ivo said, you don't have an element with the id "pen0".
You have one named "pen0", but its id is "pen02".

<input name="pen0" id="pen02"

Jul 23 '05 #5
>

What Ivo said - you have name="pen0" but no id="pen0"

simple fix

Man do I fell dumb..... Thanks you guys!!!!

Jul 23 '05 #6
Rick wrote:
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


else if (pen0.value = 3) {//This is probably not what you want.

else if (pen0.value == 3) {//This probably what you want.

Your script is unnecessarly bloated, and the Number.toFixed( ) method
works only on newer browsers(those that implement j(ava)script 1.5 )
Mick
Jul 23 '05 #7

"Mick White" <mw******@BOGUS rochester.rr.co m> wrote in message
news:7Z******** *************@t wister.nyroc.rr .com...
Rick wrote:
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


else if (pen0.value = 3) {//This is probably not what you want.

else if (pen0.value == 3) {//This probably what you want.

Your script is unnecessarly bloated, and the Number.toFixed( ) method
works only on newer browsers(those that implement j(ava)script 1.5 )
Mick

Yes I noticed the = should have been ==

Thanks very much for you help!!!
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2503
by: David | last post by:
On every web browser except Safari, this website works great. (Well, by "every" I mean Mozilla, Netscape, and Internet Explorer, for Mac and Windows). The site is: http://www.ruleofthirds.com (the problem does not exist on the first page... just all the other pages, so you'll have to click on something to see the problem) The problem lies with images swapping on rollover. I use a small
2
4372
by: Moon | last post by:
Seems I still haven't got the hang of all those window generating code in Javascript. I've got a page with about 15 photo thumbnails. When you click on a thumbnail a new window pops up which shows the enlarged version of said thumbnail. This works fine on all current browsers I've tested. However, in case I do not close the popup but click on another thumbnail instead, only IE replaces the enlarged pic by the new one, Firebird and Opera...
10
3592
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script language="JavaScript" type="text/javascript"> function show(that) { if (box.style.visibility=='hidden') { that.style.visibility = 'visible'}; }
2
1533
by: ASallade | last post by:
Hello, I've scoured my books and the web, but am still daunted, hopefully some of the users in this newsgroup will have advice for my problem. I am not an experienced javascript programmer, but have gotten my code to work well, without errors on IE, Opera and netscapes recent builds. While testing, I found that it doesnt execute on Netscape 4.7 In the head I have a script that creates a custom object/class for products,
4
1607
by: Treetop | last post by:
I have code that works in IE but not Netscape 7+. This code allows me to have a list of links that bring up an image and description in an iframe. This works great in IE, however I have users that are Netscape users. main page: var links=new Array();
5
1495
by: D E | last post by:
Here is the problem. The following script/html code works in IE, not Netscape. The javascript portion produces the text to be dynamically written in the <A HREF="">HEREHEREHERE</A> portion... The HEREHEREHEREHERE writes fine in internet explorer, but does not appear at all in Netscape 7.1. I think it might have something to do with layers... How do I correct this? Thanks. -----------------------JAVASCRIPT...
1
1105
by: viper81 | last post by:
Hello, This script works fine on Iexplorer but on Netscape 7.1 and older it doesn't works. Can someone helps me with this => <form name="frm_order" method="POST" action="http://www.reasonfreaks.com/xxx/"> <INPUT TYPE="hidden" NAME="orderID" VALUE="$bestellingen_id"> <INPUT TYPE="hidden" NAME="amount" VALUE="$b_totaal">
4
5473
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) { document.getElementById(nameOfDiv).style.visibility='visible'; document.getElementById(nameOfDiv).style.height='auto'; if (nameOfDiv != 'weblogs')
2
1316
by: John | last post by:
Code is as follows: document.write('<FORM name="horseform">'); document.write(' <SELECT SIZE="1" NAME="horsebrandslist" STYLE="font-size: 8pt">'); document.write(' <OPTION VALUE="http://my.domain.com/cat1.html">Category 1</OPTION>'); document.write(' <OPTION VALUE="http://my.domain.com/cat2.html">Category 2</OPTION>'); document.write(' <OPTION VALUE="http://my.domain.com/cat3.html">Category
28
13195
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd yow But, in firefox, for same html, getting this:
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.