add and edit in one view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: add and edit in one view (/showthread.php?tid=40260) |
add and edit in one view - El Forum - 04-04-2011 [eluser]mardon[/eluser] Hi, I want add and edit records in db in one view Code: <div id="addcert_form"> but I have problem with value in input form when I add a record the value isnt set. Its bad idea to have one form for add and edit? How to solve my problem? add and edit in one view - El Forum - 04-04-2011 [eluser]Piter[/eluser] Hi Better is: Code: <?php echo form_input(array('id' => 'ser_cislo', 'name' => 'ser_cislo', 'value'=>set_value('ser_cislo', $ser_cislo))); ?> I think it's better to do two grained forms, mute the mess in the code and faster to catch potecjalne errors. add and edit in one view - El Forum - 04-04-2011 [eluser]mardon[/eluser] Hi I fix it from you code, but still I have error in line 8 which is Code: echo form_open('admin/edit_cert/'.$id); Severity: Notice Message: Undefined variable: id even when Code: $akce = 'add' add and edit in one view - El Forum - 04-05-2011 [eluser]Piter[/eluser] You do not have the variable $id, not bestowed on it to view. |