volume calculator options?

Discussion in 'HTML & Website Design' started by CarpCharacin, May 29, 2016.

  1. #1
    So i have an aquarium volume calculator on my site that is JavaScript. A few members on this site helped me make it. I want to have a dropdown menu so people can select the units like inches and feet. I am not very good with javascript. Another member on here who helped me get started with the calculator added a reference to a share script on fishlore, another aquarium forum that is not mine and why is that there? Here is the code i am using now:
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://www.fishlore.com/scripts/js/share.js"></script>
    <script type="text/javascript">
    var result = 0;
    var roundLength = 2;
      function computeGallons()
    {
        result = Math.round((document.frmMain.TankLength.value * document.frmMain.TankWidth.value * document.frmMain.TankHeight.value / 231)*100)/100;
        document.frmMain.USGallons.value = Math.round(result*100)/100;
    }
    </script>
    <form name="frmMain"><span class="b">Aquarium Calculator: Calculate Rectangle Fish Tank Volume in Gallons Based on Tank Size</span><p>
     
            Fish Tank Length in Inches:<br />
            <input type="text" name="TankLength" onkeyup="computeGallons()"><br />
            <br />
            Fish Tank Width in Inches:<br />
            <input type="text" name="TankWidth" onkeyup="computeGallons()"><br />
            <br />
            Fish Tank Height in Inches:<br />
            <input type="text" name="TankHeight" onkeyup="computeGallons()"><br />
            <br />
            Aquarium Size is<br />
            <input type="text" name="USGallons" style="border: none; background: #D8EFFF; padding: 12px; width: 10em; font-size: 18px;" readonly> US Gallons<br />
            <br />
         
    </form>
    Code (JavaScript):

     
    CarpCharacin, May 29, 2016 IP