Hello,
I have the following problem. I edit and add new records to database through the same form. When adding new record and if there is an error on form, notice is displayed and already entered values are retained.
Now when i edit the record (action=edit), data is loaded from database, in this example ($data_group_id). But now, if user changes many values and there are errors in form, already entered values are again replaced with values from database. Here is the example code of one of the form fields:
<input type=’text’ name=’data_group_id’ value='”.($action == “edit” ? $data_group_id : $_POST[‘data_group_id’]).”‘>
I hope the explaination wasn’t too complicated.
Thank you,
Laura