I'm using JavaScript to calculate the total value in a field by adding ca, part_a, and part_b numbers. The GPA is also calculated through JavaScript. In the first row, I can get the Total and GPA values with JavaScript, but in the second and subsequent rows, I cannot retrieve them. How can I solve this issue?
<div>
<ul class="breadcrumb">
<li>
<a href="#">Home</a> <span class="divider">/</span>
</li>
<li>
<a href="#">Forms</a>
</li>
</ul>
</div>
<div class="row-fluid sortable">
<div class="box span12">
<div class="box-header well" data-original-title>
<h2><i class="icon-edit"></i>Add All Student Mark</h2>
<h3>
</h3>
<div class="box-icon">
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
</div>
</div>
<div class="box-content">
<form class="form-horizontal" action="<?php echo base_url();?>super_admin/save_all_student_mark" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Add all Student Mark</legend>
<h3>
<?php
$msg = $this->session->userdata('message');
if ($msg) {
echo $msg;
$this->session->unset_userdata('message');
}
?>
</h3>
<div class="box-content">
<table class="table table-striped table-bordered bootstrap-datatable">
<thead>
<tr>
<th>Student Roll</th>
<th>CA</th>
<th>Part A</th>
<th>Part B</th>
<th>Total</th>
<th>GPA</th>
</tr>
</thead>
<tbody>
<?php $i=0;?>
<?php foreach($student_info_by_session as $student_info){?>
<tr>
<td>
<input type="text" class="span12 typeahead" value="<?php echo $student_info->student_roll; ?>">
<input type="hidden" class="span12 typeahead" name="data\[<?php echo $i; ?>\]\[student_id\]" val...