JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 26th, 2007, 11:34 AM
nqs9000 nqs9000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 1 nqs9000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 18 sec
Reputation Power: 0
Need Help Debugging Script/Error in Script - Help a rookie troubleshoot his first javascript program

Hi,

I am computer literate, but a javascript rookie. I have a simple script I am trying to use to automate a registration form. It works just fine inside of MSfrontpage preview, but I get an error when tried in IE. The error occurs when i select any of the checkboxes on the form. The error is as follows:


Line: 25
Char: 9
Error: 'document.orderform.Item1' is null or not an object Code:0

The script is as follows: (I copied part from a free javascript page on the www)

Code:
<script type="text/JavaScript"><!-- 

        var Cost, Grand_Total;

function tally()
        {
        Cost = 0;
        if (document.orderform.Item1.checked) { Cost = Cost + 1525.00;}
        if (document.orderform.Item2.checked) { Cost = Cost + 650.00;}
        if (document.orderform.Item3.checked) { Cost = Cost + 120.00;}
        if (document.orderform.Item4.checked) { Cost = Cost + 120.00;}
        if (document.orderform.Item5.checked) { Cost = Cost + 195.00;}
        if (document.orderform.Item6.checked) { Cost = Cost + 195.00;}
        if (document.orderform.Item7.checked) { Cost = Cost + 120.00;}
        if (document.orderform.Item8.checked) { Cost = Cost + 120.00;}
       



        Cost = dollar(Cost);

        Grand_Total = parseFloat(Cost);
        Grand_Total = dollar(Grand_Total);

        document.orderform.Total.value = "$" + Cost;
        document.orderform.GrandTotal.value = "$" + Grand_Total;
        }

function dollar (amount)
{
        amount = parseInt(amount * 100);
        amount = parseFloat(amount/100);
        if (((amount) == Math.floor(amount)) && ((amount - Math.floor (amount)) == 0))
        {
                amount = amount + ".00"
                return amount;
        }
        if ( ((amount * 10) - Math.floor(amount * 10)) == 0)
        {
                amount = amount + "0";
                return amount;
        }
        if ( ((amount * 100) - Math.floor(amount * 100)) == 0)
        {
                amount = amount;
                return amount;
        }
        return amount;
}

//--></script>


I can post the complete HTML code if needed to help troubleshoot. Please help if you can! Thanks!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Need Help Debugging Script/Error in Script - Help a rookie troubleshoot his first javascript program


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway