View Full Version : calculator format script need changes

10-08-2003, 11:15 AM
Here is a partial unfinish script that does work but the
"savings" value is what I would like to change first.
The base amount is set to $15.50 a sheet, and increment of 2
cuts the price to 12.50 with 2 sheets and it follows through
to total of 5 sheets.

If 15.50's base of one sheet becomes 2 then total would be 31.00

However, since cost drops to 12.50 for 2 that gives a total of 25.00. Then the savings should be very well be $7.00.
But you will note it is giving out a result of 8.50,further down
the result is much off as well till you reach 5 sheets.

This script originally was base on percentage value that I am
trying to change to show a dollar figure saving features.

Need help for a better script if possible
<HTML><HEAD><TITLE> Calculator</TITLE>

function useRorder() {

var i=20.00

percentOfDollars = document.Rorder.CustomBox.options[document.Rorder.CustomBox.selectedIndex].value;
// alert(document.Rorder.CustomBox.options[document.Rorder.CustomBox.selectedIndex].value);

document.Rorder.displayBox.value= percentOfDollars=i*percentOfDollars;

var nPrice = eval(document.Rorder.displayBox.value);
document.Rorder.newPrice.value = (15.50 + nPrice);

// End script hiding -->


<FORM NAME="Rorder">
<TABLE ALIGN="right"><TR><TD>

<SELECT NAME="CustomBox">
<OPTION VALUE="0">1 sheet total</option>
<OPTION VALUE="0.4250">2 sheets total</option>
<OPTION VALUE="1.25">3 sheets total</option>
<OPTION VALUE="1.875">4 sheets total</option>
<OPTION VALUE="2.50">5 sheets total</option>

<B>Total sheets I will receive</B></TD></TR> <TR><TD><B>Which is $</B>
<INPUT TYPE="text" NAME="displayBox" VALUE="0" SIZE=5 MAXLENGTH=5> (savings)</TD></TR> <TR><TD><B>Making my new price</B><BR><B>$</B>
<INPUT TYPE="text" NAME="newPrice" VALUE="15.50" select style="color: #ffffce; background-color:#08007b; font-weight:bold">
</TD></TR> <TR><TD>

<INPUT TYPE="button" NAME="changer" VALUE=">>> click for TOTAL" ONCLICK="useRorder()"></TD></TR>

<FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">

<INPUT TYPE="hidden" NAME="sitenum" VALUE="19">
<INPUT TYPE="hidden" NAME="location" VALUE="clubs">
<INPUT TYPE="hidden" NAME="doit" VALUE="doit">
<TR><TD ALIGN="right"><FONT COLOR="0000FF"><B>Back to original price</B></FONT></TD>
<TD WIDTH="15%">
<INPUT TYPE="submit" NAME="goBack" VALUE="<<<">


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum