Jack: I'm far from an expert in this, but would this help you out?
http://www.pbs-one.com/pbstemp/orderform.html
Dr. Steve, Official Optometrist of the Summerfolk Festival
Office web site: http://www.log.on.ca/briggs
Summerfolk Online: http://www.summerfolk.org
Stan Rogers Page: http://www.summerfolk.org/srmain.htm
Personal web page: http://log.on.ca/users/stevebriggs/
-----Original Message-----
From: Jack Killpatrick <[EMAIL PROTECTED]>
To: Web Consultants List <[EMAIL PROTECTED]>
Date: Thursday, May 28, 1998 10:06 PM
Subject: WC:>: Javascript question
>This is probably a very stupid javascript question, but I am baffled by it.
>
>I'm trying to make a simple "calculator" type form where the values in a
>number of text boxes are added together to get the total. I have named my
>text boxes and put an onClick funtion in an <input type=button> tag. In
>theory, when you click the button, the numbers in the text boxes will be
>added together and the result will show in a "total" text box.
>
>Seems simple enough. Problem is that my javascript is treating the numbers
>in the text boxes as strings, so instead of getting 1 + 2 + 3 = 6 I get 1 +
>2 + 3 = 123.
>
>I'm doing this in the script:
>
>function calctotal(){
> myform.total.value = myform.text1.value + myform.text2.value
>}
>
>This is being called on the onClick. The myform.total.value should be the
>sum of the numbers, but they are being treated as strings. The onClick is
>working, because I'm seeing the results in the text box where I expect
them.
>I've been digging through various javascript sources looking for an answer,
>but can't find one. I've seen eval(a + b) used to combine strings, but is
>there some opposite function to force math?
>
>Thanks,
>Jack
>
>____________________________________________________________________
>--------------------------------------------------------------------
> Join The Web Consultants Association : Register on our web site Now
>Web Consultants Web Site : http://just4u.com/webconsultants
>If you lose the instructions All subscription/unsubscribing can be done
>directly from our website for all our lists.
>---------------------------------------------------------------------
>
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------