Meeyo 0 Newbie Poster

Hi,

I have my code my below that works on 1 value. But what if its already an array I cant seem to make it work when I change price to price[] and monthly_quantity to monthly_quantity[].

  <script type="text/javascript">
      function multiply()
      {

         var num1 = document.myform.price.value;
         var num2 = document.myform.monthly_quantity.value;
         var multiply = parseInt(num1) * parseInt(num2);
         document.getElementById('compute').value = multiply;
      }
    </script>

    <form name="myform">
      <input TYPE="text" NAME="price" VALUE="" onChange="multiply()"/> x 
      <input TYPE="text" NAME="monthly_quantity" VALUE="" onChange="multiply()"/>          
      <input TYPE="text" ID="compute" NAME="result" VALUE="" readonly/>

    </form>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.