Calculation...

1

116

I have 3 textboxes that I need to sum and display the sum in a different
textbox so the sum will post to the database for sorting. Unsure how to
perform calc's. Also, this would take place when the value changes (onchange
?).

Any assistance would be greatly appreciaited.

David
 
1

116

What I didn't mention was that these textboxes are in results, and not a
form. Not sure if this makes a difference.
 
T

TonySper

You say they are textboxes, are they characters in the boxes that you will
need to make numbers from so you can add them? If so you will have to
convert them first and then just add the three box vales and put the results
into the forth text box after you convert it back into text. Little more
info needed.
TonySper
 
T

TonySper

Sorry for my request. I thought I was in another VFP group not frontpage.
Please disregard my request.
TonySper
 
1

116

I am attempting to use this script to sum up 3 different textboxes and aply
the total to another. Missing something. Any assistance would be great.

<script type="text/javascript">
function calcinc()
{
with (document.FrontPage_Form1)
{RTG_TOTAL.value = +RTG_RQS.value + +RTG_OTD.value + +RTG_DEL.value}
/* Note the extra + operators. */
}
</script>

Thanks
David
 
T

Trevor Lawrence

This works for me

<html>
<head>
<script type="text/javascript">
function calcform()
{
with (document.form1)
{result.value = +val1.value + +val2.value + +val3.value}
/* Note the extra + operators. */
}
</script>
</head>
<body>
<form name="form1" action="">
<table>
<tr>
<td>A: </td>
<td><input type="text" id="val1" value="10"/></td>
</tr>
<tr>
<td>B: </td>
<td><input type="text" id="val2" value="3" /></td>
</tr>
<tr>
<td>C: </td>
<td><input type="text" id="val3" value="5" /></td>
</tr>
<tr>
<td>D: </td>
<td><input type="text" id="result" size="20" /></td>
</tr>
</table>
<input type="button" id="Calc" value="Calculate" onclick="calcform()" />
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

By Catergory... 1
Paragraph Numbering... 6
Calculation... 4
Assigning textbox value... 3
Issue with absolute walues in a yes/no table 6
textbox Do nothing 1
Running Sum 13
Need Help Report and Subreport 1

Top