473,725 Members | 2,341 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox Javascript error (maybe getElementByID)

4 New Member
Hello,

I'm really bad at javascript but I managed to get the code below to work in IE but firefox gives this error...

Error: document.getEle mentById.formal l is undefined

Basically use the script to update the display to the user depending on what they choose (qty, options, shipping etc.)

I'm sure it's simple but I could really use a hand.
Thanks!!

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language="JavaScript">
  2. function update_UsernameText()
  3. {
  4.     document.getElementById('UsernameTXT').innerHTML = document.getElementById.formall.smrtEmail.value;
  5. }
  6. function Calculate()
  7. {
  8.    // calculate each line total
  9.  
  10.     if (document.formall.extrQTY.value == 1){
  11.  
  12. document.formall.extrQTY2.value = ((document.formall.extrQTY.value) * 4).toFixed(2);
  13.     document.formall.extrTotalQTY.value = (parseFloat(document.formall.extrQTY.value) + 1);
  14.  
  15.     }else{
  16.  
  17.     formall.extrQTY2.value = ((formall.extrQTY.value) * 2.75).toFixed(2);
  18.     document.getElementById('extrQTY2A').innerHTML = formall.extrQTY2.value;
  19.     formall.extrTotalQTY.value = (parseFloat(formall.extrQTY.value) + 1);
  20.     }
  21.  
  22.     //Test Copy radio values
  23.     if(formall.testdisc_0.checked==true){
  24.     formall.extrQTY6.value = (10).toFixed(2);
  25.     document.getElementById('extrQTY6A').innerHTML = formall.extrQTY6.value;
  26.     }else{
  27.     formall.extrQTY6.value = (0).toFixed(2);
  28.     document.getElementById('extrQTY6A').innerHTML = formall.extrQTY6.value;
  29.     }
  30.  
  31.     //Paper type
  32.     if(formall.paperType_0.checked==true){
  33.     formall.extrQTY4.value = ((formall.extrTotalQTY.value) * (0.00)).toFixed(2);
  34.     document.getElementById('extrQTY4A').innerHTML = formall.extrQTY4.value;
  35.     }else{
  36.     formall.extrQTY4.value = ((formall.extrTotalQTY.value) * (0.10)).toFixed(2);
  37.     document.getElementById('extrQTY4A').innerHTML = formall.extrQTY4.value;
  38.     }
  39.  
  40.     //Disc Face type
  41.     if(formall.discFaceType_0.checked==true){
  42.     formall.extrQTY5.value = ((formall.extrTotalQTY.value) * (0.00)).toFixed(2);
  43.     document.getElementById('extrQTY5A').innerHTML = formall.extrQTY5.value;
  44.     }else{
  45.     formall.extrQTY5.value = ((formall.extrTotalQTY.value) * (0.34)).toFixed(2);
  46.     document.getElementById('extrQTY5A').innerHTML = formall.extrQTY5.value;
  47.     }
  48.  
  49.    //frmOptions1.extrQTY6.value = frmOptions1.testdisc_0.value;
  50.    formall.extrQTY3.value = ((parseFloat(formall.shrinkQTY.value))*(0.29)).toFixed(2); 
  51.     document.getElementById('extrQTY3A').innerHTML = formall.extrQTY3.value;     
  52.    formall.Subtotal.value = ((parseFloat(formall.extrQTY2.value)) + (parseFloat(formall.extrQTY3.value)) + (parseFloat(formall.extrQTY4.value)) + (parseFloat(formall.extrQTY5.value))    + (parseFloat(formall.extrQTY6.value))).toFixed(2);
  53.  
  54.     formall.Subtotal3.value = ((parseFloat(formall.Subtotal.value)) + (parseFloat(formall.Subtotal2.value))).toFixed(2);
  55.     document.getElementById('SubtotalA').innerHTML = formall.Subtotal.value;
  56.     document.getElementById('Subtotal2A').innerHTML = formall.Subtotal2.value;
  57.     document.getElementById('Subtotal3A').innerHTML = formall.Subtotal3.value;
  58. }
  59.  
  60. </SCRIPT>
May 16 '09 #1
1 2236
gits
5,390 Recognized Expert Moderator Expert
this:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById.formall;
  2.  
shouldn't work ... don't know really why the crappy IE does ... and whether it does it correctly but its completely wrong it must be:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById(formall);
and formall needs to be a valid id otherwise the method should return null.

kind regards
May 17 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2477
by: R. Rajesh Jeba Anbiah | last post by:
In IE, I could be able to directly refer the "id", but it isn't possible in Firefox. Somewhere I read the solution is to refer the id like document.getElementById("month") in Firefox. If I do so, the script works well in Firefox, but IE throws error. (I have added the code snippet below). So, my question is: is there anyway to make the script work in all browser *without* any browser fix ie, without adding any browser detection check?...
5
2216
by: LRW | last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the posting--I don't know if the message going out or not) For some reason this javascript just won't work in Firefox. It works fine in IE, though. I know, IE is a bit more permissive than IE, and sometimes lets errors work when they shouldn't. But from what I can see, I just don't see what's wrong.
2
7428
by: Cy | last post by:
Hi, I have a menu that toggles correctly in IE but is failing in FireFox V.1 and Netscape 7.1. The FireFox JavaScript Console is returning the following error; Error: document.getElementById(showDiv) has no properties. Any advice would be much appreciated. Here is the snippet of applicable code; <script language="javascript">
2
1450
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild, AppendChild, making width grow? Hi,
3
2956
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.. sorry for the long post ==
1
2468
by: KPS | last post by:
I'm attempting to create a simple treeview-like behavior in JavaScript. The desired behavior happens in IE but I cannot get the same to happen in FireFox. The primary thing I want to accomplish is to set the id and href of some objects dynamically during the onload of the page instead of hard-coding it in the HTML. I want to set the id/href so when I add new entries I don't have to remember to increment the id's. In FireFox, the href...
4
5128
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the child window. The function that is called contains an XMLHttpRequest. My problem is that everything happens as it should, the innerHTML is changed by the results of the XMLHttpRequest and the child window closes. The problem is this, in Firefox,...
1
3540
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe height based on the each iframe's content height. It is work well on IE, but the error "has no properties" occured with firefox on code as below. Where both code is to get the id of iframe on file1....
3
1741
by: riggy | last post by:
So, I have an order form that works fine in IE but when you enter the info in Firefox and click the Submit Button, nothing happens. I am not sure if the button is not working or if there is a error in the Javascript code. Regardless, I have one of those situations where I can look at this all day and see nothing. Please help! TIA..... When you click the submit buttn, I do a form fields error check . If there are errors, you get a alert. If no...
0
9248
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...
0
9092
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...
0
8072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6695
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
4506
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4775
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3212
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
2
2622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2151
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.