[thelist] [Javascript] onKeyUp error, and this should ADD not CONCATENATE

Brian Cummiskey Brian at hondaswap.com
Mon Feb 14 09:13:22 CST 2005


Tim Burgan wrote:
> 
> I have setup an example at http://www.timburgan.com/form.htm
> 
> 
> What's goin on here?


javascript assumes variables to be a string when you assign them in the 
manner that you do.

If you want them to be numbers and add, simply initialize the variables 
to 0, to force it as an int..

var field1 = 0;

filed1 = document.form.blah


More information about the thelist mailing list