I have a form where I collect basic team information. When the form is submitted the data is saved to a teams table and gets a tmID (autoincrememnt), which is the primary key of that table. Then the user is redirected to a second form to add team members, for that team, to the team_members table. I need to get the tmID value that was created when the team information was saved so that it can be added to the team member data when the member is saved. What is the best way to achieve this?
disable the redirect and enable the form debug, the debug will show you the id returned from the "insert" under the "Vars" section under the "save_data" action part
I've done that. For the last test entry I get:
[tmid] => 14
How do I get that value into my second form to add team members? Do I need to set it as a variable and if so, how? Then how do I reference it or call it in the second form?
You better append it to the redirect url and get it in the 2nd form as a data variable, so in your redirect parameters you can use:
tmid={var:save_action_name.id}
and in your 2nd form:
{data:tmid}
