I am using HTML and PHP for this scenario, the code follows :
echo"<td>".'<div class="checkbox">
<label>
<input type="checkbox" name="total" id ="total" value="'.$test['req_tot'].'" " onchange="checkTotal()">'.$test['req_tot'].'
</label>
</div>'."</td>";
Javascript:
function checkTotal() {
alert(document.getElementById("total.value"));
}
Now, when I click the checkbox, instead of displaying the value $test['req_tot']
from database it shows NULL
N.B :- Values form database are being displayed properly