Basic calculator needed (Full Version)

FrontPage Talk - Great Talk About Microsoft FrontP: http://www.frontpagetalk.com/forums/
- FrontPage Specific Issues: http://www.frontpagetalk.com/forums/default.asp?catApp=2
- - FrontPage 2002: http://www.frontpagetalk.com/forums/appid_30/tt.htm



Message


jem2002 -> Basic calculator needed (12/1/2002 2:11:36 PM)

I need a very basic calculator that would produce the following on my page:

Events [ A ] x $[ B ]/event = $ ( AxB ) Total Owed

Where the [ ]'s represent Form text boxes where users would enter numbers and the last ( ) would be the CALCULATED product of AxB. A "CALCULATE" button would also be needed. Also, the Total Owed results would have to be able to be emailed along with the rest of the form fields entered on the form.

Anyone seen or can write something like this? I have found one but it pops up the answer in a dialog box, not putting it into a ( ) form field box. Thanks!




alext -> RE: Basic calculator needed (12/1/2002 6:08:02 PM)

Hi Jem,

This might help:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script>
function getAns() {
var a = document.Calc.A.value;
var b = document.Calc.B.value;
var ans = a * b
document.Calc.Ans.value = ans;
return
}
</script>
</head>

<body>
<form name="Calc">
<p><span class="msg">Events [ <input type="text" name="A" size="5"> ] x $[
<input type="text" name="B" size="5"> ]/event = $ (
<input type="text" name="Ans" size="5"> ) Total Owed <br>
 </span></p>
<br>
<input type="button" onClick="getAns();" name="B1" value="Calculate">
</form>
</body>

</html>

Alex




jem2002 -> RE: Basic calculator needed (12/2/2002 8:48:42 PM)

Hi, that works fine as your stand-alone. But when I plug it into the middle of my form, it doesn't, and that's where I need it to work. It is intended to go into the middle of an existing form. What might be changed to allow that? Thanks much!




jem2002 -> RE: Basic calculator needed (12/2/2002 8:52:48 PM)

Hi, I might add, here is my URL where I wish to place this. It would go where I have the folks do the calc. manually now. THANKS

http://www.swimaqua.org/online_entry.htm




TexasWebDevelopers -> RE: Basic calculator needed (12/3/2002 8:46:16 AM)

Here is a java order form that I have posted here before---the code is easy to manipulate:

http://www.texaswebdevelopers.com/examples/javaorderform.htm




Herb -> RE: Basic calculator needed (12/5/2002 4:38:41 PM)

Hi Alex,
I see you are trying to solve Jems little problem. I have some what of the same problem.
Just a simple little thing like, enter how many books you would like buy at 15.00/book, add 15% tax and give me a total.
This is my site and of course I'm willing to pay for your time Alex.
My site http://www.customerservicecontracts.ca
Hope you can help
Herb




jem2002 -> RE: Basic calculator needed (12/10/2002 1:03:55 PM)

Herb, here is my page that I got to work like a want it!!

http://www.swimaqua.org/eAQUA/online_entry_ags.htm

The calc portion is near the bottom. I have become somewhat minimally educated about this, so ask any questions, I'll try. Here is code for calculator, which is in a table; note that this table must go between your <form> and </form> tags if you insert it into your form:

<table>
<tr>
<td valign="center" align="center" width="100%" colspan="4" height="21"><b><font face="Arial" size="2">TOTAL
ENTRY FEE CALCULATION</font></b></td>
</tr>
<tr>
<td valign="center" align="center" width="100%" colspan="4" height="21"> </td>
</tr>
<tr>
<td valign="center" align="center" width="25%" colspan="1" height="21"> </td>
<td valign="center" align="center" width="25%" colspan="1" height="21"><font face="Arial" size="2" color="#000000">Fee per event</font></td>
<td valign="center" align="center" width="25%" colspan="1" height="21"><font face="Arial" size="2" color="#000000">Events</font></td>
<td valign="center" align="center" width="25%" colspan="1" height="21"><font face="Arial" size="2" color="#000000">Total owed</font></td>
</tr>
<tr>
<td valign="center" align="center" width="25%" colspan="1" height="21"><font face="Arial" size="2" color="#000000">Winter Champs</font></td>
<td valign="center" align="center" width="25%" colspan="1" height="21">
<font face="Arial" size="2" color="#000000">$3.75</font>
</td>
<td valign="center" align="center" width="25%" colspan="1" height="21">
<select size="1" name="no_events" onChange="this.form.totalPrice.value = '$'+(this.options[this.selectedIndex].value*3.75);">
<option selected value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</td>
<td valign="center" align="center" width="25%" colspan="1" height="21">
<input type="text" name="totalPrice" size="5" value="0" onFocus="this.blur();">
</td>
</tr>
</table>




davemib -> RE: Basic calculator needed (1/8/2003 10:59:43 AM)

hi mike i have seen your online java order form sample.

how can i :

>edit it so that only one product is viewed and selectable
>remove the tax field

cheers




TexasWebDevelopers -> RE: Basic calculator needed (1/8/2003 1:08:40 PM)

Hi Dave,

It's pretty simple javascript.

Here's a smaller version:

http://www.texaswebdevelopers.com/examples/singleorderform.htm

The price is set at the "quantity" text box on line 77:

<input type="text" name="Item01Qty" size="3" maxlength="3" tabindex=1 value="0" onBlur="document.Form1.Item01Total.value=asMoney(5.75*document.Form1.Item01Qty.value)"

Here is an example of passing a variable right into a form field and then through a javascript calculator.




Page: [1]

Valid CSS!




Forum Software powered by ASP Playground Advanced Edition 2.0.5
Copyright © 2000 - 2003 ASPPlayground.NET