CodeIgniter Forums
Using the same form for add and edit - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Using the same form for add and edit (/thread-42267.html)



Using the same form for add and edit - El Forum - 06-01-2011

[eluser]emurad[/eluser]
Hello,

I'm wondering if using the same form in CodeIgniter for add and edit is possible and practical just like in Ruby On Rails?

Thanks.


Using the same form for add and edit - El Forum - 06-01-2011

[eluser]InsiteFX[/eluser]
Auth 1.0.6 - By Adam Griffiths

Look at the library source code for the register function.

It is for CodeIgniter 1.7.x but I have converted it to run under CodeIgniter 2.0.x

InsiteFX


Using the same form for add and edit - El Forum - 06-02-2011

[eluser]marjune[/eluser]
what do you mean? Like you got a page then your'e going to add data into database as well as retrieving it then update?


Using the same form for add and edit - El Forum - 06-02-2011

[eluser]InsiteFX[/eluser]
What he means is that he has one form but wants to use it for both editing and adding data.

Yes, it can be done download the above auth and view the source for the register function and view.

InsiteFX