Had to go back and re-read everything and still not sure I've got it 100%. Romancode is some kind of ID, I take it, which you're pulling from the DB, and you're assigning a price manually? Is that correct? So every generated row has a set ID, and text input field for the price, and you only want to process those rows where you've checked the romancode field? If so, you want something like this:
Code: Select all
<input type="text" name="price[<?= $row->romancode; ?>]" value="">
<input type="checkbox" name="romancode[]" value="<?= $row->romancode; ?>">
When it comes time to process the form, you can iterate over $_POST['romancode'] and for each value, grab the associated value of price[].
Code: Select all
<?php
$update = [];
foreach ($_POST['romancode'] as $roman) {
$update[] = [
'romancode' => $roman,
'price' => $_POST['price'][$roman],
];
}
or some such.