I have the following form input :
<input value="<?php echo isset($item['product_id']) ? $item['product_id']: ''; ?>" type="text" data-type="productCode" name="data[InvoiceDetail][<?php echo $key;?>][product_id]" id="itemNo_<?php echo $key+1?>" class="form-control autocomplete_txt" autocomplete="off" onkeyup="return tabE(this,event);">
The input auto populates with the product code, and looks like this : Manufacturer:Submanufacturer:etc:etc:model
I used the following code :
<?php
$productid = isset($item['product_id']) ? $item['product_id'] : '';
$fproductid = substr(strrchr($productid, ":"), 1);
?>
and converted the above code to such :
<input value="<?php echo $fproductid; ?>" type="text" data-type="productCode" name="data[InvoiceDetail][<?php echo $key;?>][product_id]" id="itemNo_<?php echo $key+1?>" class="form-control autocomplete_txt" autocomplete="off" onkeyup="return tabE(this,event);">
with the output being : model
However, when I save the form, and reload, the fields are blank? How can I save the form with the original data(with manufacturers), but only display the model in the user entered fields?