Insert and update in the same view |
[eluser]il_dandi[/eluser]
I've a control that manage Add and Update fuctions and that runs add_entry() and update_entry() of model. Is it possible to create a view (a single page) that manages insert and update both?? Without create two differents page?? Can you tell me the best and secure solution for manage this? Thanks!
[eluser]il_dandi[/eluser]
Hi pistolPete, I've seen the example! I would like to apply this solution to my page.... I've made many test but I've a probem. I hope that you can help me controller Code: function add() model Code: function add_entry() Can you tell me how to modify the view for manage update and insert in the same page? Thanks
[eluser]pistolPete[/eluser]
[quote author="il_dandi" date="1237168650"]Can you tell me how to modify the view for manage update and insert in the same page? [/quote] You didn't post your view file, so I can't "modify" it. If you had really tried the example from the wiki, you'd know that you need 3 functions in your controller: add(), edit(), save() In another thread I saw you are still using the old Validation class instead of the newer Form validation library; I'd recommend the latter because it's easier to repopulate the forms.
[eluser]il_dandi[/eluser]
Do you mean that the validation that I'm using in my last post is old?? I have to use the validation that I found in the wiki of this thread? I've seen the example!! What I don't know is how to manage the view!! I the post I see <fieldset> ... in my view I've the input, combo, check... fields and not the fieldset! How Can I use my view with the example that you have posted? Thanks thanks thanks!!
[eluser]il_dandi[/eluser]
In my view file I've Code: <?=form_open("admin/avatars/add");?><?=form_hidden('id', $id)?> Can you help me to create the 3 functions for manage update and insert?
[eluser]pistolPete[/eluser]
Quote:Do you mean that the validation that I’m using in my last post is old?? Yes. From the user guide: Quote:Note: As of CodeIgniter 1.7.0, this Form Validation class supercedes the old Validation class, which is now deprecated. I'd suggest rewriting your code to work with the new class. After that , have a look at this thread: http://ellislab.com/forums/viewreply/533725/ Quote:I have to use the validation that I found in the wiki of this thread?The example from the wiki is a bit outdated, I might update it sometimes. Quote:I the post I see <fieldset> ...Have a look at w3.org if you don't know some HTML elements...
[eluser]il_dandi[/eluser]
In my view file I’ve Code: <?=form_open("admin/avatars/add");?><?=form_hidden('id', $id)?> Can you help me to create the 3 functions for manage update and insert? |
Welcome Guest, Not a member yet? Register Sign In |