HighDots Forums  

Re: Help!

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Help! in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Plankmeister
 
Posts: n/a

Default 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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.