Forums

PHP

This topic is locked

how can i add the values of fields?

Posted 23 years ago
1
has voted
23 years ago A H posted:
I have a form that will insert a record into the database.

I would like to add all the fields that have a dollar value and total them below when the focus is taken off the fields.

This way the total can be seen before it is inserted into the database.

It is a web based estitmate maker that I'm trying to create - not a shopping cart.

I have seen this done with javascript but i'm not sure if it can be done in php.

Any ideas?

Thanks.

Replies

Replied 23 years ago
23 years ago Tim Green replied:
It can be done in PHP, but not in the way you wish. If you want immediate changes to occur within a page without the page resubmitting, or if you want to trap the onBlur() event, such as when the focus leaves a text field, then you will need to use JavaScript. There just isn't any other way.



Tim Green
tim@udzone.com
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 23 years ago
23 years ago A H replied:
Thanks Tim. I got it working after finding a little calculator and pullin git apart. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Cheers,

Aaron

Reply to this topic