Previous | Next | (P-PDF) Beginners
Topic: Compare Java Script
Conf: (P-PDF) Beginners, Msg: 23035
From: dug
Date: 6/28/2001 12:40 PM
On 6/28/2001 11:15:00 AM, Christie Landry wrote:
>Could someone shed some light
>on what I am doing wrong. I
>am very new to Java Script.
We all were once. Looks like you've got a little reading to do.
>var f = this.getField("Q1");
>var g = this.getField("Q2");
>event.value = f.value -
>g.value;
>function compare (f,g) {
>if (g[0] > f[0]) return 0;
>}
What exactly are you trying to do, in terms of fields and how you want them to interact?
>The error message I keep
>getting is:
>TypeError: g has no properties
Functions are supposed to live at the document level (i.e., Tools>JavaScript>Document JavaScript), so that they are available for any event that wants to call them. Although I'm not sure of it, your error is probably occurring because the interpreter doesn't know what to do with a function at this level.
Please be more specific. I'm sure this is an easy one.
--Doug