Welcome Guest, Not a member yet? Register   Sign In
_form for edit and for add
#4

[eluser]CroNiX[/eluser]
I know its a bit old, but I wouldnt check to see if post is set...as you might be passing other data via post not related to your form.

What I usually do is at the top of the view page have something like:
Code:
$is_edit = ($this->input->post('submit')) ? TRUE : FALSE;
I check for the submit value, if its true (is an edit) then use the posted form value if not use the db value:
Code:
<?php echo form_input('firstname', ($is_edit) ? set_value('firstname') : $user_data['firstname']) ; ?>


Messages In This Thread
_form for edit and for add - by El Forum - 09-23-2009, 07:13 AM
_form for edit and for add - by El Forum - 09-23-2009, 07:42 AM
_form for edit and for add - by El Forum - 09-23-2009, 08:15 AM
_form for edit and for add - by El Forum - 10-28-2009, 12:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB