I'm kinda rookie at PHP but i'm trying to developing a backoffice with some tables and value-editing options.
By now, i have tables like this:

But i'm kinda bugged with this issue:
The change button is being implemented like this:
for ($i = 0; $i < count($a); $i++) {
?>
<tr>
<td><i onclick="
document.form1.deviceFeatValID.value = <?php echo $a[$i][DEVICE_FEATURE_VALUE_ID] ?>;
document.form1.deviceID.value = <?php echo $a[$i][DEVICE_ID] ?>;
document.form1.deviceClassFeatID.value = <?php echo $a[$i][DEVICE_CLASS_FEATURE_ID] ?>;
document.form1.deviceFeatureVal.value = <?php echo $a[$i][DEVICE_FEATURE_VALUE] ?>;
document.form1.submit();" class="icon-refresh" ></td>
<td><?php echo $a[$i]['DEVICE_FEATURE_VALUE_ID']; ?><td><?php echo $a[$i]['DEVICE_ID']; ?><td><?php echo $a[$i]['DEVICE_CLASS_FEATURE_ID']; ?><td><?php echo $a[$i]['DEVICE_FEATURE_VALUE']; ?>
</tr>
<?php
}
?>
That is, by Javascript, i set the input values of this form, in the same .php:
<form name="form1" method="post" action="deviceFeatureValueFRM.php">
<input type="hidden" name="deviceFeatValID"/>
<input type="hidden" name="deviceID"/>
<input type="hidden" name="deviceClassFeatID"/>
<input type="hidden" name="deviceFeatureVal"/>
<input type="hidden" name="hiddenTypeField"/>
</form>
But...do you consider that this is a good practice? Is there another solution?!
The goal of this code is to detect which line is going about to be edited.
Kind regards,
Sam