Welcome Guest, Not a member yet? Register   Sign In
help: losing uri segment when failing form validation
#6

[eluser]WanWizard[/eluser]
[quote author="pabloheim" date="1278797691"]in the form, the url in the action attribute the same asthe controller
Code:
<?php echo form_open('controller/edit');?>
as you can see, it doesnt contain the id. im putting it in a hidden input :
Code:
<?=form_hidden('id_item',$id_item)?> //comes from the $data['id_item'] in the controller
then manage all in the model to insert new information[/quote]
So it's quite logical that after you submit the form the id is no part of the URI, since you didn't include it.

You have to retrieve it from the posted form. I recommend not to use $this->input->post(), but to validate it properly using the form validation library, and after validation use set_value() to access the ID variable.


Messages In This Thread
help: losing uri segment when failing form validation - by El Forum - 07-10-2010, 10:12 AM
help: losing uri segment when failing form validation - by El Forum - 07-10-2010, 10:22 AM
help: losing uri segment when failing form validation - by El Forum - 07-10-2010, 10:34 AM
help: losing uri segment when failing form validation - by El Forum - 07-12-2010, 06:10 AM
help: losing uri segment when failing form validation - by El Forum - 07-12-2010, 06:15 AM
help: losing uri segment when failing form validation - by El Forum - 07-12-2010, 08:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB