Popular Searches: FrontPage Hosting | FrontPage Templates | FrontPage Training | Free FrontPage

Basic calculator needed   Logged in as: Guest
  Printable Version
All Forums >>FrontPage Specific Issues >>FrontPage 2002 >> Page: [1]
Name:
Message<< Newer Topic  Older Topic >>

jem2002

 

Posts: 50
Member since: 9/24/2002
From: USA

Basic calculator needed 

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!
  Report Abuse |  Date: 12/1/2002 2:11:36 PM

alext

Posts: 27
Member since: 9/24/2002
 

RE: Basic calculator needed (in reply to jem2002

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
  Report Abuse |  Date: 12/1/2002 6:08:02 PM

jem2002

 

Posts: 50
Member since: 9/24/2002
From: USA

RE: Basic calculator needed (in reply to jem2002

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!
  Report Abuse |  Date: 12/2/2002 8:48:42 PM

jem2002

 

Posts: 50
Member since: 9/24/2002
From: USA

RE: Basic calculator needed (in reply to jem2002

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
  Report Abuse |  Date: 12/2/2002 8:52:48 PM

TexasWebDevelopers

Posts: 7200
Member since: 9/24/2002
From: USA

RE: Basic calculator needed (in reply to jem2002

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


_____________________________



Follow us on TWITTER
  Report Abuse |  Date: 12/3/2002 8:46:16 AM

Herb

 

Posts: 5
Member since: 9/24/2002
From: Canada

RE: Basic calculator needed (in reply to jem2002

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
  Report Abuse |  Date: 12/5/2002 4:38:41 PM

jem2002

 

Posts: 50
Member since: 9/24/2002
From: USA

RE: Basic calculator needed (in reply to jem2002

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>
  Report Abuse |  Date: 12/10/2002 1:03:55 PM

davemib

 

Posts: 9
Member since: 12/31/2002
 

RE: Basic calculator needed (in reply to jem2002

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
  Report Abuse |  Date: 1/8/2003 10:59:43 AM

TexasWebDevelopers

Posts: 7200
Member since: 9/24/2002
From: USA

RE: Basic calculator needed (in reply to jem2002

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.



< Message edited by TexasWebDevelopers -- 1/8/2003 1:40:47 PM >



_____________________________



Follow us on TWITTER
  Report Abuse |  Date: 1/8/2003 1:08:40 PM
Page:   [1]
All Forums >>FrontPage Specific Issues >>FrontPage 2002 >> Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



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

0.046875