This topic is locked

Additional Add Page

2/7/2020 5:51:56 PM
PHPRunner General questions
J
Jan K. van Dalen author

Hi Everyone,
Ok, I created an additional Add Page (lets call it AddX).
I'm able to call it and the page is working correctly but I want after the user clicks on "save" to reset the form and stay on it. Right now, after I click save (on the new add page ... AddX), the data is save but then it goes to the default add page (not AddX)
Any idea on who to change this behavior?
Thanks in advance.

jadachDevClub member 2/8/2020

Use the event after record added and redirect to your new add page

J
Jan K. van Dalen author 2/10/2020

Hi Jerry,
In the Events, there is a single location for Add page. I want the code to only affect the 2nd Add page. Obviously I'm missing something.



Use the event after record added and redirect to your new add page

Admin 2/10/2020

This is correct that there is only one AfterAdd event that will be executed for both pages. You will have to distinguish between these two pages in your event somehow. There are several ways to do that. For instance, if you have a field that only appears on one of the pages you can check if this field belongs to the $values array and if it does - it will tell you what page you are on.

J
Jan K. van Dalen author 2/10/2020

Thanks you ... I guess, a future feature? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=90258&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
The only difference is how the form is called from the menu. Thought of passing a session variable or query string but don't see how to accomplish that with ASPRunner.net. I'll try to figure out a way. Again, thanks.



This is correct that there is only one AfterAdd event that will be executed for both pages. You will have to distinguish between these two pages in your event somehow. There are several ways to do that. For instance, if you have a field that only appears on one of the pages you can check if this field belongs to the $values array and if it does - it will tell you what page you are on.

Admin 2/10/2020

Yes, session variable will work too.
PS. this is a PHPRunner forum. You can find an example of using a session variable in ASPRunner.NET in this article for instance:

https://xlinesoft.com/asprunnernet/docs/session_variables.htm