I want to add a calculator to my site

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm very new to web design and programming.

I want to add a calculator that users can enter info and get a result, then
reset and start over if needed.


How can i accomplish this?

thanks
 
zewkey said:
I'm very new to web design and programming.

I want to add a calculator that users can enter info and get a
result, then reset and start over if needed.


How can i accomplish this?

thanks

If you really want one there are plentt out there.

Here is just the first one I found
http://dynamicdrive.com/dynamicindex11/cal.htm

(I googled for calculator script)
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
i dont need a entire calculator,

i need for my user to enter a two numbers, my site does the calculation and
displays the result. for example.. current line= +120, amount you want to
bet= $17. my site does the calculation and returns how much they can win.
most of my users cannot figure out how to enter this into a common calculator
 
zewkey said:
i dont need a entire calculator,

i need for my user to enter a two numbers, my site does the
calculation and displays the result. for example.. current line=
+120, amount you want to bet= $17. my site does the calculation and
returns how much they can win. most of my users cannot figure out how
to enter this into a common calculator

Post the formula that you want applied and I should be able to create a form
that will do it.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
thanks trevor,

1. if the first number entered has a + (like +400,) then it would be 400/100.

2. if the first number entered has a - (like -250,) then it would be 100/250

3. that result will be multiplied by the second number entered, which will
be a posive dollar amount.


example:

i enter figure 1 (-350)----100/350 = .285
i enter figure 2 ($25)

result is $ 7.125
Trevor L. said:
zewkey said:
i dont need a entire calculator,

i need for my user to enter a two numbers, my site does the
calculation and displays the result. for example.. current line=
+120, amount you want to bet= $17. my site does the calculation and
returns how much they can win. most of my users cannot figure out how
to enter this into a common calculator

Post the formula that you want applied and I should be able to create a form
that will do it.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
zewkey said:
thanks trevor,

1. if the first number entered has a + (like +400,) then it would be
400/100.

2. if the first number entered has a - (like -250,) then it would be
100/250

3. that result will be multiplied by the second number entered, which
will
be a posive dollar amount.


example:

i enter figure 1 (-350)----100/350 = .285
i enter figure 2 ($25)

result is $ 7.125
Trevor L. said:
zewkey said:
i dont need a entire calculator,

i need for my user to enter a two numbers, my site does the
calculation and displays the result. for example.. current line=
+120, amount you want to bet= $17. my site does the calculation and
returns how much they can win. most of my users cannot figure out how
to enter this into a common calculator

Post the formula that you want applied and I should be able to create a
form
that will do it.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
zewkey said:
thanks trevor,

1. if the first number entered has a + (like +400,) then it would be
400/100.

2. if the first number entered has a - (like -250,) then it would be
100/250

3. that result will be multiplied by the second number entered,
which will be a posive dollar amount.


example:

i enter figure 1 (-350)----100/350 = .285
i enter figure 2 ($25)

result is $ 7.125

Try this
It requires the + or - to be entered separately. I couldn't easily get it to
accept it as one field. But perhaps this is a good idea. You can add text to
explain what the + and - mean.

The result is rounded to 3 digits and a dollar sign added. You can adjust
this as you require

<html>
<head>
<script type="text/javascript">
function calcform()
{
with (document.form1)
{ var temp = (sign.value == '+') ? number1.value/100 : 100/number1.value
result.value = '$' + Math.round(temp * number2.value * 1000)/1000 }
}
</script>
</head>
<body>

<form name="form1" action="">
Plus/Minus (enter + or - ):<br />
<input type="text" id="sign" value="+" size="1" /><br/>
Number 1 (enter number):<br />
<input type="text" id="number1" value="" size="40" /><br/>
Number 2 (enter value in dollars, e.g. 2.50) :<br />
<input type="text" id="number2" value="" size="40" /><br/>
Result:<br />
<input type="text" id="result" value="" size="40" /><br/>

<input type="button" id="Calculate" value="Calculate"
onclick="calcform()" />
<input type="reset" id="reset" value=" Clear "/>
</form>

</body>
</html>

--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
Trevor-

YOU ARE THE MAN!!! WoooHooo

thanks

Trevor L. said:
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
zewkey said:
thanks trevor,

1. if the first number entered has a + (like +400,) then it would be
400/100.

2. if the first number entered has a - (like -250,) then it would be
100/250

3. that result will be multiplied by the second number entered, which
will
be a posive dollar amount.


example:

i enter figure 1 (-350)----100/350 = .285
i enter figure 2 ($25)

result is $ 7.125
Trevor L. said:
zewkey wrote:
i dont need a entire calculator,

i need for my user to enter a two numbers, my site does the
calculation and displays the result. for example.. current line=
+120, amount you want to bet= $17. my site does the calculation and
returns how much they can win. most of my users cannot figure out how
to enter this into a common calculator

Post the formula that you want applied and I should be able to create a
form
that will do it.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
Back
Top