dillpickle79
11-05-2003, 08:23 PM
okay, I'm an asolute beginner with javascript, though I've known the language for two years. This is the first time I've ventured as far as using it. I currently am working on a simple form for a web site that calculates 2 selections and adds together their values. I've managed to display their values in text boxes, but the subtotal section just won't add them right. When I use the script, it treats the numbers as other languages would treat strings. eg: 100 + 100 is displayed as 100100. This is the script I am using basicaly to add the subtotals.
<select name="select3" onclick="javascript: document.form.subtotal.value = document.form.select3.value + document.form.select2.value">
seems simple enough but it doesn't work.
I'm also going to later on use multiplication and division, so I'm hoping that the magic solution that you give me will work for that too.
Thanks a lot!
<select name="select3" onclick="javascript: document.form.subtotal.value = document.form.select3.value + document.form.select2.value">
seems simple enough but it doesn't work.
I'm also going to later on use multiplication and division, so I'm hoping that the magic solution that you give me will work for that too.
Thanks a lot!