Welcome Guest, Not a member yet? Register   Sign In
Form used in new and edit mode
#1

[eluser]Samuurai[/eluser]
Hi everyone,

Just wondering if I am doing this in a really stupid way or not, can someone please tell me if this is the best way to use a form for both registering and for editing the users details later?

I load the view with the $new or $edit variable set, depending on what mode I want to be in. If not variable is set, the form loads in view mode onle.

Then in the view, my code looks like this:
Code:
<?=if(isset($new)):?>
    <?=form_input('first_name')?>
<?=elseif(isset($edit)):?>
    <?=form_input('first_name', $row->first_name)?>
<?=else:?>
    <?=$row->first_name?>
<?=endif;?>


Messages In This Thread
Form used in new and edit mode - by El Forum - 09-23-2009, 11:17 AM
Form used in new and edit mode - by El Forum - 09-23-2009, 11:45 AM
Form used in new and edit mode - by El Forum - 09-23-2009, 12:29 PM
Form used in new and edit mode - by El Forum - 09-23-2009, 02:22 PM
Form used in new and edit mode - by El Forum - 09-23-2009, 04:07 PM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:04 AM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:32 AM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB