[Javascript] Javascript and FF

Philip Thompson philthathril at gmail.com
Mon Aug 31 09:59:21 CDT 2009


On Aug 30, 2009, at 7:46 AM, Del Wegener wrote:

> ----- Original Message -----
> From: "Troy III Ajnej" <trojani2000 at hotmail.com>
>
>> The javascript error is at line 424,
>>   if (calculator.measurement_units[k].checked == true)
>> The report says: "calculator" is not defined.
>>
>>
>> I never found any references to "calculator" - what is it? Is it an
>> element?
>
>
> Hi Troy;
> I found the same error and am confused.
> calculator is the name of the form.
> In the past I assumed that the statement in line 189
> function process_form(calculator)
> did declare/define calculator.
> This function is called when the "estimate" button is clicked on the  
> form so
> it has been executed before line 424..
>
> If that is no longer valid, what is?  Where do I find such  
> information?
> Thanks.
> Del

BTW, I think you meant "document.calculator," not just "calculator."  
You have to give it a context. You have 2 options (off the top of my  
head):

1. Change all instances of calculator to document.calculator
2. Keep calculator and assign document.calculator to it before calling  
it

var calculator = document.calculator;

Of course, you would have to do this for every scope necessary.

Cheers,
~Philip




More information about the Javascript mailing list