[Javascript] Adding values in input boxes

Scott Reynen scott at randomchaos.com
Thu Jun 1 08:52:36 CDT 2006


On Jun 1, 2006, at 8:41 AM, Alan Easton wrote:

> I simply want to be able to add up the 3 boxes when any of them  
> change, but also catch when nothing has been entered.i.e. when the  
> value is undefined.

What do you want to happen when you catch undefined values?  I do  
this in an auto-adding page:

valueOne = parseFloat( inputField.value );
if ( isNaN( valueOne ) ) valueOne = 0;

Peace,
Scott




More information about the Javascript mailing list