0

Hi i am looking for a script to put on my website that will have the following

Number of Pallet Spaces (customer to enter 1 2 or 3 )
1 0.95p per mile
2 1.10 per mile
3 1.25 per mile
Price per mile not to be shown on the form

then amount of miles

Then a totals box.

I have tried to use other and change the script but i am new to this so struggling a bit.
If anyone could help i would be greatful.
here is a link to my spreadsheet of how i would like the calculator to be.
Red = customer cannot change
Green = customer add the miles
file:///C:/Users/mike%20bunting/Desktop/Bunting%20Courier%20Services%20stationary/milage%20calculator.htm

Regards
Mike

3
Contributors
2
Replies
15
Views
2 Years
Discussion Span
Last Post by jalarie
0

Did you expect us to be able to access your local file on your PC from here?

This forum is for help, sure, but not for doing all the work for you. If you need some programming work done, then tell us how much you're offering for this, otherwise show us specifically where you're stuck. Show your markup / code.

-1

Start with this and change as needed:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
  <head>

    <title>Mike</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Language" content="en-US" />
    <meta name="Author" content="James Alarie - jalarie@umich.edu" />
    <meta name="description" content="Page for Mike." />
    <meta name="keywords" content="calculator" />

<!--
Hi i am looking for a script to put on my website that will have the following

Number of Pallet Spaces (customer to enter 1 2 or 3 )
 1 0.95p per mile
 2 1.10 per mile
 3 1.25 per mile
 Price per mile not to be shown on the form

then amount of miles

Then a totals box.

I have tried to use other and change the script but i am new to this so struggling a bit.
 If anyone could help i would be greatful.
 here is a link to my spreadsheet of how i would like the calculator to be.
 Red = customer cannot change
 Green = customer add the miles
 file:///C:/Users/mike%20bunting/Desktop/Bunting%20Courier%20Services%20stationary/milage%20calculator.htm

Regards
Mike
-->

  </head>

  <body id="test01" class="body1">
   <div id="Body">
<!-- Page Header -->
    <div id="Header">
      <h1>Mike</h1>
      <hr />
    </div>

<!-- Content -->
    <div id="Content">
      <br />
      <noscript>
        <p class="notice">
          You must have scripting enabled to make full use of this page.
        </p>
      </noscript>
      <script type="text/javascript">
        /*<![CDATA[*/
"use strict";

  function CalcIt() {
    var f1, INumPI, INumPT, INumPV, IMiles;
    f1=document.forms[0];                           // abbreviation
    INumPI=f1.NumP.selectedIndex;                   // select index
    INumPT=f1.NumP.options[INumPI].text;            // ...on-screen text
    INumPV=f1.NumP.options[INumPI].value;           // ...embedded value
    IMiles=f1.NumMiles.value;
    f1.TotalCost.value=INumPV*IMiles;
  } // CalcIt

        /*]]>*/
      </script>

      <div class="center">
        <form method="post" action="javascript:void(0);">
         <div class="form">
          <label for="NumP">Number of Pallets:</label>
          <select tabindex="1" name="NumP" id="NumP" onchange="CalcIt();">
            <option value="0.95" selected="selected">1</option>
            <option value="1.10">2</option>
            <option value="1.25">3</option>
          </select>
          <br />
          <label for="NumMiles">Number of Miles:</label>
          <input tabindex="1" type="text" size="20" value="0" name="NumMiles" id="NumMiles" onfocus="this.select();" onchange="CalcIt();" />
          <br />
          <label for="TotalCost">Total Cost:</label>
          <input tabindex="1" type="text" size="20" value="0" name="TotalCost" id="TotalCost" onfocus="this.select();" />
         </div><!-- form -->
        </form>

      </div><!-- center -->
    </div>

<!-- Page Footer -->
    <div id="Footer">
      <br clear="all" /><hr />
      Written on August 21, 2015, by:&nbsp;
      <a tabindex="1" href="mailto:jalarie@umich.edu">James Alarie</a>.
    </div>

   </div>
  </body>

</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.