formtools / core

The Form Tools Core.
https://formtools.org
207 stars 78 forks source link

Default value options for different scenarios #218

Open DiegoJArg opened 6 years ago

DiegoJArg commented 6 years ago

Hi team, First, thank you for this great tool.

I am trying to use this as a datalogging form replacing current employees paper-forms and data entries.

One feature that I would need to improve performance is that some data, don't get deleted after a submit. Using other words. the default value of next empty form, should be the last sent value and the first focused field should be the first blank required field. This is important only for some fields, not for all.

Example: In a production line the selection of the field "Production Line" would remain constant for that production line, while the form is used in multiple lines.

Is this possible now-a-days?

DiegoJArg commented 6 years ago

I am trying to upload some pictures to show the form, but it is rejecting the upload.

I guess that what I need is to have some hard-fields and other soft-fields, where the hard-fields only changes in location, like which production line is the PC in, which operator is sitting in front, which product is being manufactured, so they don't change too often when working in the same PC, while the soft-fields requires to be loaded by the operator at every submit.

I think that the hard-fields concept is something to be implemented in browser-side with javascript&cookies instead of database entries at server side. But I have no clue on how to achieve this.

All data should get into the same row of the same table.

benkeen commented 6 years ago

Interesting! So just so I understand correctly, you're adding submissions to a form within Form Tools, and you'd like the next new submission that's created to contain fields that were used in the previous submission? In your scenario did you want ALL the previous fields to be copied over, or just some?

For this feature, it's almost like you really need a "Copy" button to duplicate a form submission...

And I can absolutely imagine that auto-focusing on the first empty field be useful, if the script is being used for some heavy data inputting.

But at the moment, neither of these features are available I'm afraid. But great suggestions and I'll certainly keep them in mind.

DiegoJArg commented 6 years ago

Hi benkeen

Yes.. recover previous submission data into new forms as default values. This could be done by storing the last value into cookies. I am very new to know, but do you have a way to, push a new javascript hack file?

No. Not all fiels should be copied. Just some of them. Copying all could lead to duplicated entries.

No. Is not really a button to copy submission contents. It could be a checkbox into each field setup to enable the autosaving and autorecovering using cookies.

Yes. The form would be used for heavy inputing. Approx 50 rows per shift. Autofocusing may help to have a reduced cycletime.

I may be able to help if you point me in the right direction

DiegoJArg commented 6 years ago

sry. I accidentally closed it, Opened back again. This feature would be really appreciated.

DiegoJArg commented 6 years ago

Hi benkeen, Would you please add such a feature please?

To enable/disable, it would only require a checkbox into the view's field setup, adding to each field an optional subclass like "cookies_default": For example: <input id="First_Name" class="cookies_default" It may be done in other ways to not change php code, but a javascript addin is necessary.

Next site explains exactly what I need from defaulting values to cookies. http://jsfiddle.net/Xxqb6/3/ https://stackoverflow.com/questions/10580289/store-form-values-in-cookie

Of course, the populate method should be called after the form is loaded or after cleared. and stored after each submit.

Any help is greatly appreciated !!

DiegoJArg commented 6 years ago

Hi benkeen, did you took a look into this?