Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: function calculate???


Message #1 by "Robert Sindall" <rsindall@z...> on Thu, 12 Sep 2002 13:22:49 +0100
getElementById is a method of document, not of forms

> -----Original Message-----
> From: Robert Sindall [mailto:rsindall@z...]
> Sent: jeudi 12 septembre 2002 14:23
> To: javascript
> Subject: [javascript] function calculate???
> 
> 
> Hi
> 
> why doesn't this work!?!?
> 
> function calculate(gallons, result, DiVal){
> 
> var Gals = document.forms(0).getElementById(gallons)
> var Res = document.forms(0).getElementById(result)
> alert(Gals);
> alert(Res);
> alert(DiVal);
> 
> Res = (Gals/DiVal);
> 
> }
> 
> 
> thanks
> 
> 
> ---
> 
> Improve your web design skills with these new books from Glasshaus.
> 
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/th
eprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

  Return to Index