View Full Version : sum Form Fields
GTIMANiac
12-13-2002, 07:08 PM
I am working on a from (time card) that I need to have onBlur sum fields.
i need to sum for the day for the task and for the week. is there a good tutorial or FAQ on how best to do this?
requestcode
12-13-2002, 07:56 PM
I have always had problems using onBlur with form text fields. I would suggest you use onChange. You might check out the tutorials for this site http://www.javascriptkit.com
Also:
http://www.htmlgoodies.com
http://hotwired.lycos.com/webmonkey/
GTIMANiac
12-13-2002, 07:58 PM
Thanks ...
I am new to java and could easily do it in via my CFML parser, but the present setup uses java and the natives would be restless if things changed.
GTIMANiac
12-13-2002, 08:51 PM
OK.
Here is a snippt of what the form looks like. Since we charge by TASK there may be more than one time entry for eachday. The form is created via a loop. So the # in the day of the week could be up to ?
I need to sum them per day, per task, and per week. The fields SatTotal, etc ... are readonly and will be written by the sum function.
If anyone could offer anything it would be greatly appreciated, actually willing to pay someone to aid if need be.
<input type="text" name="SatTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="SunTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="MonTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="TuesTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="WedTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="ThuTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="FriTime1" value="" size="4" onChange="TimeClac()">
<input type="text" name="SatTotal" size="4" readonly>
<input type="text" name="SunTotal" size="4" readonly>
<input type="text" name="MonTotal" size="4" readonly>
<input type="text" name="TueTotal" size="4" readonly>
<input type="text" name="WedTotal" size="4" readonly>
<input type="text" name="ThuTotal" size="4" readonly>
<input type="text" name="FriTotal" size="4" readonly>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.