Re: Help! -
09-20-2003
, 12:48 PM
In your functions you aren't accessing the relevant value. You have:
data=x.num.value
in all the functions, but in your separate forms, the id attribute of each
is different, so the script cannot get the correct value. If you give each
of your text inputs a unique id. For example, respectively:
id="sqrt_input"
id="squared_input"
id="tan_input"
You can then replace these lines in your functions:
x=document.[whatever]
data=x.num.value
with this:
data = document.getElementById("sqrt_input").value
Obviously you'll have to change the quoted value to reflect the real names
you assign to your ID attributes for each of the functions.
I haven't tested this, but at first glance that would definitely appear to
be the issue. Also, I think your function tangent() is a reserved word. Try
changing it to my_tangent() or something...
HTH.
P. |