PDA

View Full Version : Dynamic Form calculating


andyede
09-23-2004, 12:41 PM
Hi guys,

I'm looking for a way of adding up the values in some text inputs and displaying the total below them. the idea being that people using the form will only be able to put in values that add upto a pre-determined total. i can check this easily using the server side CGI which its submitted to but i want a way of showing the user what they have entered dynamically.

would this be possible to do in real time or would it have to be done on user selection ie. clicking a button. I'm not very familiar with JS so i need some help with this one.

it would also be nice to be able to check the total values entered are not over the maximum. again i can do this easily in cgi but would rather it happened before submition.

Andy

LynxGrr
09-23-2004, 12:44 PM
You could do this with javascript and the ONKEYUP or ONCHANGE events.

andyede
09-23-2004, 12:49 PM
ok thats a good start but i'm going to need more help than that. i don't really know how to go about making something like this, let alone doing it from scratch

Willy Duitt
09-23-2004, 12:52 PM
Plenty of examples on this forum which can be found by using the forum search (http://www.codingforums.com/search.php?) feature and calculating as the keyword....

......Willy

andyede
09-24-2004, 06:14 AM
ok cheers. think i got what i needed. i'll be back if i can't customize it