Savings Calculator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hi2shy
    New Member
    • Mar 2008
    • 1

    Savings Calculator

    Hi everyone!

    I am rather stuck trying to create a very simple savings calculator on a website. All I need to have is a field for number of PC's, Printers, Servers and how much is spent per month on IT.

    When they click the "get Quote" button, I'm hoping to show them how much I can save them!! This is what I have so far, if anyone can help, that would be so great!

    [HTML]<script type="text/javascript">
    function MyCalc(){
    var val1 = document.frmqut .textPc.value;
    var amt1 = 190 * parseFloat(val1 );
    var val2 = document.frmqut .textPrinter.va lue;
    var amt2 = 50 * parseFloat(val2 );
    var val3 = document.frmqut .textServers.va lue;
    var amt3 = 900 * parseFloat(val3 );
    var val4 = document.frmqut .textCost.value ;
    var amt4 = parseFloat(val4 );

    var amt = amt4 - (amt1 + amt2 + amt3);
    alert("Your monthly total to support these PC's will be £" + amt);
    }
    </script>
    <font color="#666666" >Please Enter Number of PC's</font><br>
    <input type="text" name="textPc">
    <br>
    <font color="#666666" >Please Enter Number of Printers</font><br>
    <input type="text" name="textPrint er">
    <br>
    <font color="#666666" >Please Enter Number of Servers</font><br>
    <input type="text" name="textServe rs">
    <br>
    <font color="#666666" >Please Enter Monthly IT Cost</font><br>
    <input type="text" name="textCost" >
    <br>
    <input type="button" name="btnCalc" value="Get the Quote" onclick="MyCalc ()">
    </p>[/HTML]

    Someone kindly helped me by sending me this very basic script.

    TIA
    Hi2Shy
    Last edited by gits; Mar 15 '08, 09:45 PM. Reason: added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You just need to wrap the form elements within form tags named "frmqut".

    Comment

    Working...