View Single Post
Old 01-23-2013, 07:28 PM   PM User | #9
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 946
Thanks: 7
Thanked 97 Times in 97 Posts
WolfShade is an unknown quantity at this point
Thumbs up

Code:
function displayTotal(){ 
var adult = document.getElementById('adult').value == "" ? 0 : parseFloat(document.getElementById('adult').value) ; 
if(isNaN(adult)) { adult = 0; }
  ... // use the above as a template for the rest
var total = parseFloat(adult + child + senior + military + seniorday + studentday); 
alert("The total is " + total); 
}
I did not pay attention to the IDs and whatnot that Philip M did. But JS _is_ case sensitive, so getElementbyId won't work, it has to be getElementById.
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote