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:

<td>
  Black Eyed Susan
</td>
<td align="center">
  <input type="text" name="blackeyedsusan" value="" size="3" maxlength="3" onChange="javascript:calculatecharges();"/>
</td>

And the script:

function calculatecharges() {
    var totalPackets = 
        Number(blackeyedsusan.value) +
        ... various other things...    ;

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

Error: blackeyedsusan is not defined


Any ideas?

Recommended Answers

All 2 Replies

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

Number(document.formName.blackeyedsusan.value) ...

That appears to have fixed the problem. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.