The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
|
Adding 'Remember me' to a form - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Adding 'Remember me' to a form (/showthread.php?tid=359) |
Adding 'Remember me' to a form - martin_undefined - Nov 5th, 2009 Has anyone had any success in adding a 'remember me' element to their forms? I'm trying to figure out how I could do this. I'm trying to emulate the functionality of a commercial hosted form solution that I've used before. In this case what 'remember me' does is automatically populate name, contact details etc. so if the user is submitting multiple forms (with different content) they don't have to keep re-typing their name etc. Any suggestions are welcome. Thanks Martin RE: Adding 'Remember me' to a form - Ben - Nov 7th, 2009 Terrific idea. I can certainly see how this could be helpful. A little information first. Form integration via the API is handled via sessions (database or PHP). When the user first arrives at the form, it reserves a unique record ID for the form, then keeps track of info as the user progresses through the form. On the final page it submits the content for that unique ID and empties sessions. So at that point, all data is emptied. If they return to the form at that point, a new submission ID is reserved and they start anew. The trick will be to circumvent this and tell it to remember certain field values. One hack solution would be to do this: on the final page, right before emptying sessions, store the fields you want in a temporary array. Then empty sessions (ft_api_clear_form_sessions()). Then, store the fields back in the $_SESSION var. Finally, on the first page of your form, after the ft_api_init_form_page() call, check the return value to see if $fields contains empty values for some of the form fields (e.g. the required ones). If it's empty, stick the values from $_SESSION back into that var. Hack? Yup. I'll put this down as a feature request. It would nice to have this as a built-in option. - Ben RE: Adding 'Remember me' to a form - martin_undefined - Nov 8th, 2009 Thanks Ben. I was originally thinking that I might be able to achieve this using a cookie but your suggestion seems cleaner. I'll have a crack at this and see how I go! RE: Adding 'Remember me' to a form - iroast - May 11th, 2010 (Nov 8th, 2009, 12:31 PM)martin_undefined Wrote: Thanks Ben. I was originally thinking that I might be able to achieve this using a cookie but your suggestion seems cleaner. Hi Martin, Did you get that 'remember me' feature working? I would be interested in using that feature :-) RE: Adding 'Remember me' to a form - Bethagerton - May 30th, 2021 No, I had not actually but my friends did that once. If you want any assistance regarding this title then visit essay writing services reviews here he is working and delighting his work because he is working as freelancers for earnings. |