[Pro] Store values in Form Fields

Hi guys,

got a lil thing in my german forum board where I honestly am more than blank with a suitable answer. It should be read as:

“Is it possible to keep the entries of a form-field even the user is leaving the page coming back later?”

The form is done with Tim’s PHP Feedback form (as far as I am oriented).

Glad of any pointer.

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Thomas,
I can think of several ways to do this but I’d probably do it all using cookies and JavaScript like this;
Set a cookie of the user’s machine that holds the form data until the form is submitted. You’d need to add some JavaScript to the page that looks for key events or blur events on each form item and writes or updates a cookie with the form values. Once the form is sent (maybe on the thank you page) you’d have another block of JavaScript that clears the cookie data. Lastly on the form page itself you’d have another block of JavaScript that looks for the cookie and populates the form values from the settings stored in the cookie. This way the form data should persist until the form is sent (or until the cookie expires).
Regards,
Tim.

On 20 Sep 2013, at 08:11, Thomas Kimmich wrote:

got a lil thing in my german forum board where I honestly am more than blank with a suitable answer. It should be read as:

“Is it possible to keep the entries of a form-field even the user is leaving the page coming back later?”

The form is done with Tim’s PHP Feedback form (as far as I am oriented).

Glad of any pointer.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Tim,

the good news:

I totally understood what you mean and how this would work (and I even was convinced that this is the way).

The bad one:

I can’t write not even one line of JavaScript code nor do I know how to set a cookie on users’ machine.

But I will have a google or is there something you could point me to. Learning JavaScript is (after all that InlineConstruction stuff) probably the next I should have a closer look into - probably.

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Depends on the audience, but HTML local storage might be more straight forward: Local Storage - Dive Into HTML5

Joe

On 20 Sep 2013, at 13:47, Thomas Kimmich email@hidden wrote:

Hi Tim,

the good news:

I totally understood what you mean and how this would work (and I even was convinced that this is the way).

The bad one:

I can’t write not even one line of JavaScript code nor do I know how to set a cookie on users’ machine.

But I will have a google or is there something you could point me to. Learning JavaScript is (after all that InlineConstruction stuff) probably the next I should have a closer look into - probably.

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Joe,
That was one of the other ways I thought this could be done although, as you imply, support would be somewhat limited to fairly recent browsers.

Thomas, this may get you started although I’m not sure why they are storing the data when the form is submitted;
http://www.the-art-of-web.com/javascript/setcookie/

Regards,
Tim.

On 20 Sep 2013, at 13:58, Joe Billings wrote:

Depends on the audience, but HTML local storage might be more straight forward: Local Storage - Dive Into HTML5


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thomas - if you have a look at this thread Walter offers a Cookie storing cart http://freewaytalk.net/thread/view/108340

This could certainly be adapted to do what you want.

I have my own implementation at http://www.deltadesign.co/fw_examples/walts_scripts/index.html which collects all the details and sends them via a form handler created using the PHPFF action.

However a lot of it is added via markup.

D


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s a simplified version that stores all of the fields in the form, whenever you make any changes to them.

http://scripty.walterdavisstudio.com/memo.html

Walter

On Sep 20, 2013, at 8:01 PM, DeltaDave wrote:

Thomas - if you have a look at this thread Walter offers a Cookie storing cart http://freewaytalk.net/thread/view/108340

This could certainly be adapted to do what you want.

I have my own implementation at http://www.deltadesign.co/fw_examples/walts_scripts/index.html which collects all the details and sends them via a form handler created using the PHPFF action.

However a lot of it is added via markup.

D


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Guys,

first a big thank for rushing in - very helpful.

Walter - I’ll take a look into yours and pass it through to my german board, any chance to get the FW file?

The HTML5 route seems also a thing to keep in mind however it’s watching the horizon with no chance to view land - currently.

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I didn’t do the original example in Freeway, but here’s one you can download for dissection. You will need the Protaculous 2 Action to use this. I made a few improvements over the original in the process – it will handle any type of form control, and the reset takes whatever the default value is for the field, it doesn’t just wipe the field to empty.

http://scripty.walterdavisstudio.com/memo.freeway.zip

Walter

On Sep 23, 2013, at 5:42 AM, Thomas Kimmich wrote:

Hi Guys,

first a big thank for rushing in - very helpful.

Walter - I’ll take a look into yours and pass it through to my german board, any chance to get the FW file?

The HTML5 route seems also a thing to keep in mind however it’s watching the horizon with no chance to view land - currently.

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

incredible helpful, thanks so much.

Quick question:

Path to cookiejar script points to a cdn, which will mean that it is consistent or do I have to save the script local?

Another more strange point:

I had several problems with my beloved CrowBar and unfortunately with the Protaculous2 as well (nearby similar).

Both are not keeping their values as expected. In CrowBar, I recognized, that it ignores alterations when scripts are already applied and even disconnects master/child or even resets the content to empty.

Something similar happened on the above memo page example. If I make simple changes such as moving the position of the table, the function part in the DOM Loaded Observer is reset to simply empty.

Naturally strange to point you to any example or to describe it more precisely - it is simply a “hmmmm?”

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I can’t repeat that here. Do you have any other Actions on the same page, or are you just opening my memo.freeway page and experimenting there? I’m using Freeway 6.1.0 here.

Walter

On Sep 24, 2013, at 3:16 AM, Thomas Kimmich wrote:

Something similar happened on the above memo page example. If I make simple changes such as moving the position of the table, the function part in the DOM Loaded Observer is reset to simply empty.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Also, did you download and install the most recent version of Protaculous 2? There will be an embedded copy in the document, and it should work, but it’s always best to install Actions before you open a document that needs them.

Walter

PS: Yes, the CDN address should remain stable for a very long time.

On Sep 24, 2013, at 3:16 AM, Thomas Kimmich wrote:

Something similar happened on the above memo page example. If I make simple changes such as moving the position of the table, the function part in the DOM Loaded Observer is reset to simply empty.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I usually do not use any Prototype/Scriptaculous/FX Actions.

Most of the time only two:

ID to class and Clearfix.

… and naturally CrowBar in the past.

In THIS specific case (latest P2 v 1.0.3 installed) I simply opened and … but watch yourself:

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Wow. Thanks for this report. I don’t have 6.1.1 running here, but I will have to see what I can figure out when I do.

Please copy this to support, I know that they will be fascinated…

Walter

On Sep 24, 2013, at 10:02 AM, Thomas Kimmich wrote:

I usually do not use any Prototype/Scriptaculous/FX Actions.

Most of the time only two:

ID to class and Clearfix.

… and naturally CrowBar in the past.

In THIS specific case (latest P2 v 1.0.3 installed) I simply opened and … but watch yourself:

https://vimeo.com/75306149

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry for my ignorance Walter,

but I still haven’t got the gist how the cookies are set.

Am I correct that it is by hitting send or is it an automatic process that I miss?

Feel (lil) ashamed about my dumbness :frowning:

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Don’t be. Each time the form element observes a keyup event, the cookie is updated. This is the sort of live-save behavior you may recognize from iPad or the online iWork suite.

Walter

On Sep 27, 2013, at 10:31 AM, Thomas Kimmich wrote:

Sorry for my ignorance Walter,

but I still haven’t got the gist how the cookies are set.

Am I correct that it is by hitting send or is it an automatic process that I miss?

Feel (lil) ashamed about my dumbness :frowning:

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Aha - OK, so reflector.php is NOT required for running, it’s just the “result” of collecting? And reset cookies could be also something like “Clear Form”?

I gave this further to the original poster on my forum, but it didn’t seem to work for whatever reason. I have to investigate this probably myself cause I don’t trust things I have not in my hands (if I find a bit of time).

Cheers

Thomas


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options