The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Incomplete Forms - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17) +--- Thread: Incomplete Forms (/showthread.php?tid=641) |
Incomplete Forms - lukeboy317 - Apr 7th, 2010 I have a two page form has some client side validation of contact info on the first page. The second page is then a survey that potential clients fill out. If for some reason they dont finish the survey, I still want their contact info for a follow up. I am receiving the data in my phpAdmin window on my database, but the unfinished form is not being sent to form tools. Any ideas? RE: Incomplete Forms - Ben - Apr 9th, 2010 Hi lukeboy, Interesting! This is one use-case I hadn't thought of. The reason this is happening is because of the "finalized" field for the submission. Quick explanation first, then I'll explain how to fix it for your case. In most scenarios, people won't want to see incomplete submissions in Form Tools - they only want to see those that have been fully filled in. That's where the finalized submission database field comes in. All new submissions via the API are set to finalized = no. On the very LAST step of the form, you pass in a "finalize" => true parameter to the ft_api_process_form function. That does the job of marking the submission as complete (finalized = yes) and from that point onwards, it'll appear within Form Tools. This is the standard way to do it - I think you're the first person to request it work another way! In your case, what you need is for all submissions to be finalized on the very first step. This is no problem (I'll explain below) but there is a caveat: the ft_api_process_form() function automatically sends any emails out the moment a submission is finalized. Now that's a problem. Assuming your form has one or more email templates defined, you presumably want to continue sending them ONLY at step 2, correct? Otherwise emails will get submitted for incompletely filled out forms. So yes, that's the problem. I've logged it as a bug, here: http://bugs.formtools.org/index.php?cmd=view&id=217 But it should be pretty simple to fix. If you like, post me back and I'll release an update to the API this weekend to include a workaround. In the meantime, if you DON'T have any email templates for your form, you can set all new submissions to be finalized very simply by passing the finalize key to the ft_api_process_form function on step 1 of your form, something like this: PHP Code: $params = array( Sorry, long response! But I hope the info helps - - Ben RE: Incomplete Forms - lukeboy317 - Apr 10th, 2010 (Apr 9th, 2010, 10:06 PM)Ben Wrote: Hi lukeboy, Thanks Ben, I appreciate the help. I will add the finalize command to the code, and will check back to see the response on the e-mail bug. RE: Incomplete Forms - Ben - Apr 10th, 2010 Hey lukeboy, All fixed. Download the latest version of the API (1.0.1) from here: http://docs.formtools.org/api/?page=ft_api_process_form I've updated that page with a little documentation to explain the new setting. What you'll need to do is explicitly tell the ft_api_process_form() function when to send the emails. So on the first page, add this key-value pair: PHP Code: $params = array( On the final page, add PHP Code: $params = array( After this is done, even though the submission is finalized on step1, it'll only send the emails on step2. Hope this helps! - Ben |