I'm trying to get the value of a Text input according to your ID.
in php I'm printing that way, I'm making a query. And according to the results. I'm printing with the Foreach. the amount of inputText passing them the ID.
<?php
foreach($resultado as $row){
$IDcali=$row['IDcali'];
?>
<input type="text" id="<?php echo$IDcali;?>" min="0" max="10" name="<?php echo$IDcali;?>" class="form-control" "></th>
<th>
<button type="button" class="btn btn-pink" onclick="RegistroCali(<?php echo$IDcali;?>)>Guardar</button>
<?php
}
?>
<script>
function RegistroCali(IDcali){
var calificacion=document.getElementById(IDcali).value;
alert(calificacion);
alert(IDcali);
}
</script>
I'm trying to send the IDcali to the JS function. to be able to recover its value that has been introduced in the input text. but he does not recognize me. I do not know what I'm doing wrong. since if I show in the alert. it prints the value that is receiving but if I show the qualification. it says indefinitely.