944,123 Members | Top Members by Rank

Ad:
Mar 29th, 2007
0

Javascript not working in Firefox

Expand Post »
I'm having a bit of a problem getting my javascript to run in Firefox (version 2.0). It works fine in IE6.

Here's the HTML:

HTML Syntax (Toggle Plain Text)
  1. <td>
  2. Black Eyed Susan
  3. </td>
  4. <td align="center">
  5. <input type="text" name="blackeyedsusan" value="" size="3" maxlength="3" onChange="javascript:calculatecharges();"/>
  6. </td>


And the script:

JavaScript Syntax (Toggle Plain Text)
  1. function calculatecharges() {
  2. var totalPackets =
  3. Number(blackeyedsusan.value) +
  4. ... various other things... ;

When this function executes, I get the following error on the Error Console:

Error: blackeyedsusan is not defined


Any ideas?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
alskdjf is offline Offline
2 posts
since Mar 2007
Mar 30th, 2007
0

Re: Javascript not working in Firefox

I think you need to reference the form name as well so it would be something like this:

Number(document.formName.blackeyedsusan.value) ...
Reputation Points: 17
Solved Threads: 14
Posting Whiz
DanceInstructor is offline Offline
355 posts
since Feb 2005
Mar 30th, 2007
0

Re: Javascript not working in Firefox

That appears to have fixed the problem. Thanks.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
alskdjf is offline Offline
2 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: foarm input output functions
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Manual Up & Down controlled content





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC