Comments (5)
Hi, Ben:
Thought of that and was hoping to go without a lot of modifications to the app. As-is, this will only affect someone who shares a workstation (rotating shifts0 or a kiosk. I think we can live with that. What I’m attempting to do now is save the form data after an AJAX call is used to populate some of the elements. I’m using the $(‘#form1).sayt({‘savenow’ : true}); but it doesn’t appear to save all the elements (two dropdowns). I’m also using the ‘erase’ : true when a reset button is clicked, but two input boxes appear to be repopulated after the reset. Other than that, things have tested out very well – thanks for the plugin, greatly appreciated!!
Bill
From: Ben [mailto:[email protected]]
Sent: Wednesday, July 09, 2014 1:51 PM
To: BenGriffiths/jquery-save-as-you-type
Cc: wmpnj
Subject: Re: [jquery-save-as-you-type] Cookies are saved with form id which isn't unique to sessions (#6)
Hi,
There's no way to do this directly, however you could store the session ID in a hidden form variable, and check it before restoring the form data.
—
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/6406308__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMDU1ODI2MywiZGF0YSI6eyJpZCI6MzY2MjkwNTF9fQ==--f1360e6f4d90e26c7c54a9de69b6df7d912b93b8.gif
from jquery-save-as-you-type.
Haha, you got there before I'd deleted my reply - the only out of the box way I can think of doing is if you appended the session ID to the form ID's - it's not a very elegant solution though. I'll have a think about adding a feature for session IDs with the cookies.
from jquery-save-as-you-type.
I don’t think it’s so much session ID as user ID. The session will not persist for 3 days for example. So, when instantiating, we’d do something like { ‘Id’ : ‘11100000987’ ]. I looked at js-cookie to see if I could manipulate the names, but it did not appear to be a quick solution and the more I thought of that, the more I wanted to avoid named cookies. The best, IMHO, approach would be one object whose id attribute was the id of the user.
Just thoughts for the future should others desire something similar. For now, I think we’re ok. We don’t have kiosks and if someone does share a desk, then they are sharing similar roles, responsibilities and data.
Bill
From: Ben [mailto:[email protected]]
Sent: Thursday, July 10, 2014 5:13 AM
To: BenGriffiths/jquery-save-as-you-type
Cc: wmpnj
Subject: Re: [jquery-save-as-you-type] Cookies are saved with form id which isn't unique to sessions (#6)
Haha, you got there before I'd deleted my reply - the only out of the box way I can think of doing is if you appended the session ID to the form ID's - it's not a very elegant solution though. I'll have a think about adding a feature for session IDs with the cookies.
—
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/6406308__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMDYxMzU5OSwiZGF0YSI6eyJpZCI6MzY2MjkwNTF9fQ==--140b107c0460a6adf2764f9068d49599e70e33f2.gif
from jquery-save-as-you-type.
Unrelated question: any thoughts on why sayt is not saving/restoring select list options? Even if I choose a value from a dropdown, then enter some text into an input textbox, the select value is not being restored.
Thanks,
Bill
From: Ben [mailto:[email protected]]
Sent: Thursday, July 10, 2014 5:13 AM
To: BenGriffiths/jquery-save-as-you-type
Cc: wmpnj
Subject: Re: [jquery-save-as-you-type] Cookies are saved with form id which isn't unique to sessions (#6)
Haha, you got there before I'd deleted my reply - the only out of the box way I can think of doing is if you appended the session ID to the form ID's - it's not a very elegant solution though. I'll have a think about adding a feature for session IDs with the cookies.
—
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/6406308__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMDYxMzU5OSwiZGF0YSI6eyJpZCI6MzY2MjkwNTF9fQ==--140b107c0460a6adf2764f9068d49599e70e33f2.gif
from jquery-save-as-you-type.
I think I found a way to provide unique names despite Visual Studio refusing to build my app with a form identifier that isn’t static.
We use an EDIPI – electronic data interchange personal identifier- to uniquely identify users. If I try the following, my build fails:
”If I leave it at <form id=”CreateCaseForm” and then after the DOM has loaded use jQuery to change the id, like this:
$('#CreateCaseForm').attr('id', 'CreateCaseForm<% =user.getEdiPI() %>');
And use that same id everywhere I reference the form, i.e.
$('#CreateCaseForm<% =user.getEdiPI() %>').sayt();
Then the app builds and deploys and at runtime the unique identifier is part of the form id and thus the cookie name.
This appears to work in my local testing.
HTH,
Bill
From: Ben [mailto:[email protected]]
Sent: Thursday, July 10, 2014 5:13 AM
To: BenGriffiths/jquery-save-as-you-type
Cc: wmpnj
Subject: Re: [jquery-save-as-you-type] Cookies are saved with form id which isn't unique to sessions (#6)
Haha, you got there before I'd deleted my reply - the only out of the box way I can think of doing is if you appended the session ID to the form ID's - it's not a very elegant solution though. I'll have a think about adding a feature for session IDs with the cookies.
—
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/6406308__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMDYxMzU5OSwiZGF0YSI6eyJpZCI6MzY2MjkwNTF9fQ==--140b107c0460a6adf2764f9068d49599e70e33f2.gif
from jquery-save-as-you-type.
Related Issues (18)
- plugin is not functioning HOT 6
- Hidden form fields also saved HOT 4
- Form fields not being updated
- data-sayt-exclude removes element from page HOT 13
- Check boxes
- Elements removed in Firefox (38.0.5) using SAYT 1.4.3 HOT 1
- Unchecked checkboxes are rechecked when form is retrieved
- cookie saved when local storage exist
- Exclude fields from saving? HOT 1
- Elements being removed V 1.4.4 - tested on FF42 HOT 1
- Erase form - Not working HOT 1
- Select2 support
- cKeditor support
- SummerNote WYSIWYG
- Exclude Bug with Fix
- Radio buttons data not saving
- Texarea is not saving HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-save-as-you-type.