title: using javascript function in php while loop
body: <p>I am trying to multiply values in two text boxes and place it on a third text box... Using javascript and php while loop with onclick event.....How to do that??
  my code is </p>
  
  <pre><code>&lt;script language="javascript"&gt;
  
      function multiply()
      {
  
         var textValue1 = document.getElementById('CLS').value;
         var textValue2 = document.getElementById('rate').value;
  
         document.getElementById('valuation').value = textValue1 * textValue2;
  
      }
      &lt;/script&gt;
  &lt;?php
  $a="some query";
  $b=mysql_query($a);
  while($c=mysql_fetch_array($b))
  
  {
  echo "&lt;td&gt;".$CLOSINGstk."&lt;/td&gt;
  &lt;input type='hidden' name='CLOSINGstk".$a."' value='".$CLOSINGstk."' id='CLS".$a."'&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='rate".$a."' id='rate".$a."'&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='valuation".$a."' id='valuation".$a."' onclick='multiply();'&gt;&lt;/td&gt;";
  }
  ?&gt;
  </code></pre>