Skip to main content
Topic: Stay on same page after add (Read 1454 times) previous topic - next topic

Stay on same page after add

Maybe it is simple but I struggle for few days now.

On View Page for master table record I have included Add Page for detail table. I prepopulate Add form through Field Value Data Bind. After submit I would like to stay on same View Page and keep master record id. What should I enter in Redirect To After Add?

Many thanks!

Re: Stay on same page after add

Reply #1
Got it finaly...

Make Add page custom and add code:
Code: [Select]
$_SESSION["curpage"] = $comp_model->view->form_data["request_uri"];

In action After Add add code:
Code: [Select]
redirect_to_page($_SESSION["curpage"]);exit;

Hope this helps someone.