خرید بک لینک
this is the java script that i want to run when keyup get the total but this is not working


Code:

$noofrow++;
$sqlstr=mysql_query("SELECT * From Frame_Components WHERE Main_Category='FR30' ");
    while($record=mysql_fetch_array($sqlstr))
        {
        $noofrow++;
       

        ?>
    <tr>
      <td colspan="2"><label>
       
        <?php echo '<input id="itemname'.$noofrow.'" name="itemname'.$noofrow.'" value="'.$itemname.'" type="text" size="8" maxlength="12" readonly="readonly" style="text-align:center"  />' ; ?>
      </label></td>
      <td width="124"><label>
     
       
        <?php //echo '<input id="itemp'.$noofrow.'" name="itemp'.$noofrow.'" value="0" type="text" size="8" maxlength="12"  style="text-align:center" onkeyup="ttlsum()" />' ; ?>
        <input type="text" name="itemp'.$noofrow.'" id="itemp'.$noofrow.'" onkeyup="ttlsum()" value="0" />
      </label></td>
    </tr>
    <?
        }

<input type="percen" name="" />

function ttlsum()
{

                var f1=document.getElementById("titem").value;
                               
                               
                                var PCT;
                               
                var sum=0;
                               
                for(var  j=0; j<= f1; j++)
                                {
                    //val=parseInt(itemp[j].value);
                                        PCT =parseInt(document.getElementById("itemp"+j).value,2);
                                        //alert(fl);
                                       
                  sum=sum+PCT;
                }
                               
             
              document.getElementById("percen").value=sum;



}



</script>

برچسب: نویسنده: آیلین رضوانی تاريخ: چهارشنبه 20 دی 1396 ساعت: 7:09

صفحه بندی