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

[eluser]Flemming[/eluser]
OK second attempt!

At the very top of your edit() method, above the validation IF, put the $id into a variable like this:

Code:
$edit_id = $this->uri->segment(3);
if(! $edit_id) $edit_id = $this->input->post('id_item);
// if there's still no ID, redirect somewhere safe
if(! $edit_id) redirect('some_controller');

that should solve your problem I think


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