Try this:

 *** 'varname' is equivalent to <input name='varname'
type=text value='var_value'>***


//adding

var total;


//html

 <input name=varname1 type=text value=5 onChange="javascript: 
total=total+form.varname1.value">

//once the content of varname1 is changed, the value will be added to total

 <input name=varname2 type=text value=10 
onChange="javascript:total=total+form.varname2.value">

//add varname2 to total


...or something to that effect. Double check the syntax...

hope that that helped.



__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Mon, 22 Oct 2001, Stefan Rusterholz wrote:

> >From: "KING OGNAJD" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Monday, October 22, 2001 9:33 AM
> >Subject: [PHP] Update onBlur or onChange
>
>
> >Helo:
>
> >Iım working on a form that Iıd like to have a feature that adds your total
> >as items are selected. Currently, Iıve got some javascript doing the job
> but
> >it only works in ie, and besides, Iıd rather use php if possible.
>
> >The current prototype form lives at http://www.seatthole.com/order2.php
>
> >Can anyone tell me if thereıs a way to update the total at the bottom of
> the
> >page in realtime as the user makes changes?
>
> >Thanks...
>
> >Django
>
> PHP is a server-side language, which means that it had to be reloaded each
> time you want to do an update which is not realtime. IMHO that's not that
> what a user expects because it takes more time to send and reload than to
> calculate the new price yourself ;-) (as long as you have a poor connection)
>
> Two possible solutions:
> -I think the javascript solution ist the best. I don't see any reason why it
> doesn't run in Netscape (I didn't look at the code but I know that there is
> a way to get it work)
> -Second: Not realtime - total appears after sending it. You can combine this
> solution with the first to avoid problems with browsers that have JavaScript
> disabled (I'd recomend that anyway)
>
> Regards
> Stefan Rusterholz, [EMAIL PROTECTED]
> ----------------------------------
> interaktion gmbh
> Stefan Rusterholz
> Zürichbergstrasse 17
> 8032 Zürich
> ----------------------------------
> T. +41 1 253 19 55
> F. +41 1 253 19 56
> W3 www.interaktion.ch
> ----------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to