call a javascript function in php input type = text value
<p>I am currently working a <strong>Employee Performance Appraisal</strong> calculation in hrms weightage and rating value I got from backend database automatically.i need weightage and rating value in point field.formula <code>point =(weightage/100)*rating</code>.</p>

<p>I want know calling a javafunction and correct code for this point field</p>

<pre><code>    &lt;td&gt;
         &lt;input type="hidden" name="txtgetRate" id="txtgetRate" value="&lt;?php echo trim($kpi-&gt;getRate())?&gt;" /&gt;
         &lt;input type="hidden" name="txtgetWeight" id="txtgetWeight" value="&lt;?php echo trim($kpi-&gt;getWeight())?&gt;" /&gt;
         &lt;input id="txtPoint" name="txtPoint" type="text" class="smallInput" value="&lt;?php echo $_GET["getPoint ()"];?&gt;"
 valiadate="1" /&gt;

         &lt;/td&gt;
</code></pre>

<p>Javascript</p>

<pre><code>//points value
var point;

function getPoint() {
    getWeight = "&lt;?php echo trim($kpi-&gt;getRate())?&gt;";
    getRate = "&lt;?php echo trim($kpi-&gt;getWeight())?&gt;";
    point = (getWeight / 100) * getRate;
    document.calculator.total.value = point;
}
</code></pre>
