A
Anonymous
Guest
Hi all,
I'm using the code below to try and get the value of $DocNames when I change the DoCNames.
But is keeps giving me the very first record's data instead of the one I changed.
How do I refer to the spesific records I changed?
Thanks a lot
I'm using the code below to try and get the value of $DocNames when I change the DoCNames.
But is keeps giving me the very first record's data instead of the one I changed.
How do I refer to the spesific records I changed?
Thanks a lot
Code:
<?php
$resulthistory = mysqli_query($mysqli, "SELECT * FROM ScanDocs");
while($res = mysqli_fetch_array($resulthistory)) {
echo "<tr>";
$ID = $res['ID'];
$DocNames = $res['DocNames'];
$DocDescript = $res['DocDescript'];
echo "<td><input type='text' name='DocNames' id='iddocnames' onchange='updatedocnamef()' value='$DocNames'></td>";
}
?>
</table>
<script>
function updatedocnamef() {
var x = document.getElementById("iddocnames").value;
alert(x);
}
</script>