title: why i dont receive my post values of text box
body: <p>from these for loop iam using javascript to calculate  the total of mark1,mark2,mark3 and the average of the total...</p>
  
  <pre><code>&lt;input type="text" name="tblRowCount" id="tblRowCount"  /&gt;  
      &lt;table align="center" width="100%" border="0" class="table_Style_Border" id="table"&gt;
          &lt;input type="text" name="txtrowcount" id="txtrowcount" /&gt;
  my for loop is this
      $a = 1;
             for($i=0;$i&lt;sizeof($StudName);$i++) { ?&gt;
          &lt;tr align="left"&gt;
          &lt;td class="table_label"&gt;&lt;? echo $code[$i].' - '.$StudName[$i]; ?&gt;&lt;/td&gt;
  
          &lt;td&gt;&lt;input type = "text" name="mark1&lt;?= $a ?&gt;" id="mark1&lt;?= $a ?&gt;" &gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type = "text" name="mark2&lt;?= $a ?&gt;" id="mark2&lt;?= $a ?&gt;" &gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type = "text" name="mark3&lt;?= $a ?&gt;" id="mark3&lt;?= $a ?&gt;" 
          onkeyup="return percent('mark1&lt;?= $a ?&gt;','mark2&lt;?= $a ?&gt;','mark3&lt;?= $a ?&gt;','total&lt;?= $a ?&gt;','Average&lt;?= $a ?&gt;')" &gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type = "text" name="total&lt;?= $a ?&gt;" id="total&lt;?= $a ?&gt;"
           onkeyup="return percent('mark1&lt;?= $a ?&gt;','mark2&lt;?= $a ?&gt;','mark3&lt;?= $a ?&gt;','total&lt;?= $a ?&gt;','Average&lt;?= $a ?&gt;')"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type = "text" name="Average&lt;?= $a ?&gt;" id="Average&lt;?= $a ?&gt;" &gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;? $a++; } ?&gt;
  </code></pre>
  
  <p>this is my javascript</p>
  
  <pre><code>function percent(mark1,mark2,mark3,total,Average)
  {
      var tbl = document.getElementById('table');
      var mark1value=document.getElementById(mark1).value;
      var mark2value=document.getElementById(mark2).value;
      var mark3value=document.getElementById(mark3).value;
      var totalvalue=document.getElementById(total).value;
      var averagevalue=document.getElementById(Average).value;
      total_1 = parseInt(mark1value)+parseInt(mark2value)+parseInt(mark3value);
      average_1 = total_1/3;
      document.getElementById(total).value = total_1.toFixed(2);
      document.getElementById(Average).value = average_1.toFixed(2);
  
  }
  function tblrowcount()
      {
          var tblid = document.getElementById('table'); 
           //alert(tblid);
  
          //alert(tblRowcount);
          document.getElementById('txtrowcount').value = tblid.rows.length-1;
          return true;
      }
  function removeRowFromTable()
      {
          var tbl = document.getElementById('table');
          var lastRow = tbl.rows.length;
          if (lastRow &gt; 2) 
          {
          tbl.deleteRow(lastRow - 1);
          document.getElementById('tblRowCount').value=tbl.rows.length-1;
          }
       }
  </code></pre>
  
  <p>how can i receive the post values
  i tried it this way but that didnt work for me</p>
  
  <pre><code>function Addmark()
      {
  
      for($a=1;$a&lt;=$rowcount;$a++)
      {
  
          $markI='mark1'.$a;
          $markII='mark2'.$a;
          $markIII='mark3'.$a;
          $total='total'.$a;
          $avg='Average'.$a;
  
          $mI[] = $this-&gt;input-&gt;post($mark1);
          $mII[] = $this-&gt;input-&gt;post($mark2);
          $mIII[] = $this-&gt;input-&gt;post($mark3);
          $Total[] = $this-&gt;input-&gt;post($total);
          $Avrg[] = $this-&gt;input-&gt;post($Average);
  
      }
  
          $res = $this-&gt;staffModel-&gt;Addmark($mI,$mII,$mIII,$Total,$Avrg);
  
  
                  if($res==true)
  
                         {
                              $this-&gt;session-&gt;set_flashdata('response', 'data added successfully !');
                          }
                      else
                          {
                              $this-&gt;session-&gt;set_flashdata('response', 'data already exist !');
                          }
  
                  $this-&gt;load-&gt;view('Sstudentlist',$data);
  }   
  </code></pre>
  
  <p>how can i get the values</p>