Hello David -
That works perfectly. RGFormsModel::get_lead() really makes it easy, too.
I have something else I need to do but haven't quite been able to find the hook that will help, and I'm hoping you can point me in the right direction. The client has decided they want to have the user complete one pre-application form. If they are approved, they can return to the site, and complete the application process on a multi-page form. Here's how I'm thinking I can accomplish this:
1) user completes first form
2) I save the lead_id to a cookie (if they have cookies disabled, I'll have them login with email/password)
3) use RGFormsModel::get_lead() to get the data and populate the form, stashing the lead_id into a hidden field
That's all straightforward. Where I'm having difficulty coming up with a solid solution is how to make sure the lead_id from the first form is the same as the lead_id from the rest of the application which is a different form.
My initial thought was to use the gform_entry_created hook, grab the lead_id from the hidden field, and after the entry has been saved, update the newest entry, changing the lead_id to what's in my hidden field. Do you think that makes sense, or would you suggest a better way of doing it? Also, when going from one page to the next on a multi-page form, how is the lead_id tracked?
Thanks so much for any help you can provide.
Posted 8 years ago on Thursday June 14, 2012 | Permalink