Creating a Form

G

Guest

I have created a form for our cashiers to total cash, checks and credit card
receipts. I have a text field box for each type. I then have a "grand
total" line with a text box. When submitted the form will go to a shared
mailbox in accounting office. The accounting reps are asking if the "grand
total" can be calculated automatically by adding the 3 field entires
together. I am not seeing anyway to do this. I am wondering if anyone has
everdone something like this.
 
G

Guest

I'm green here. What type of search wording should I use to find what I am
looking for?
 
P

Paul C

Hi here is a form page which adds the fields together you will have to add
the submit to email form
Paul M

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> add em </title>
<meta name="description" content="Adds form content">
</head>
<body>
<script type="text/javascript">
function calcTotalPub(theForm){
var tempcash = theForm.elements['txtCash'].value;
var tempchecks = theForm.elements['txtchecks'].value;
var tempccards = theForm.elements['txtCcards'].value;


theForm.elements['txtTotalPub'].value = Number(tempcash)
+ Number(tempchecks)
+ Number(tempccards);
}
</script>
</head>
<body>
<h2>Here is the form</h2>
<form name="Form1">
<input type="text" name="txtCash">Cash<br>
<input type="text" name="txtchecks">checks<br>
<input type="text" name="txtCcards">credit cards<br>
<input type="text" name="txtTotalPub" value="--">Total<br>
<input type="button" value="Total"
onclick="calcTotalPub(this.form);"><br>
<input type="reset" onclick="reset();">
</form>
</body>
</html>
 
P

Paul C

Here is another one
http://javascript.internet.com/forms/auto-sum-form-boxes.html

Paul C said:
Hi here is a form page which adds the fields together you will have to
add the submit to email form
Paul M

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> add em </title>
<meta name="description" content="Adds form content">
</head>
<body>
<script type="text/javascript">
function calcTotalPub(theForm){
var tempcash = theForm.elements['txtCash'].value;
var tempchecks = theForm.elements['txtchecks'].value;
var tempccards = theForm.elements['txtCcards'].value;


theForm.elements['txtTotalPub'].value = Number(tempcash)
+ Number(tempchecks)
+ Number(tempccards);
}
</script>
</head>
<body>
<h2>Here is the form</h2>
<form name="Form1">
<input type="text" name="txtCash">Cash<br>
<input type="text" name="txtchecks">checks<br>
<input type="text" name="txtCcards">credit cards<br>
<input type="text" name="txtTotalPub" value="--">Total<br>
<input type="button" value="Total"
onclick="calcTotalPub(this.form);"><br>
<input type="reset" onclick="reset();">
</form>
</body>
</html>


Shelleen said:
I have created a form for our cashiers to total cash, checks and credit
card
receipts. I have a text field box for each type. I then have a "grand
total" line with a text box. When submitted the form will go to a shared
mailbox in accounting office. The accounting reps are asking if the
"grand
total" can be calculated automatically by adding the 3 field entires
together. I am not seeing anyway to do this. I am wondering if anyone
has
everdone something like this.
 

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

Top