top | item 4767056

Show HN: garlic.js - don't let your users lose their form data

212 points| guillaumepotier | 13 years ago |guillaumepotier.github.com | reply

105 comments

order
[+] fruchtose|13 years ago|reply
I think the desire for this kind of project is very reasonably based, and it looks like you have done great work on most of the implementation. I have one gripe with it, though.

It would be nice if the documentation mentioned that garlic.js requires an HTML5 browser with localStorage implemented. Remember, there are people who are still using Internet Explorer 6 and 7, and these browsers are incompatible [1]. This is a minor details considering browser marketshare, but a fallback using cookies would be a nice-to-have feature.

Besides that, awesome work!

[1] http://www.quirksmode.org/dom/html5.html#t00

[+] recuter|13 years ago|reply
I get the sentiment here but considering this is an enhancement to the user experience that IE6/7 users will never know they missed out on either way...

You don't need to backport everything, only the critical stuff.

[+] gildas|13 years ago|reply
It would also be nice if the documentation mentioned that it requires jQuery.
[+] guillaumepotier|13 years ago|reply
Yes,

I'll definitely re-work on both the code and the doc. I've read that there is a kind of localStorage portage for IE8- that I'll look into.

Currently, if the browser does not support localStorage, the plugin auto-disable.

Best

[+] twmb|13 years ago|reply
I disagree to a certain extent. I don't believe in catering to the possible 5% [1] market share that will not upgrade their browsers. Anything that strongly suggests people to upgrade is better, imo. I don't care for the entire notion of including everybody when it calls for more code bloat and makes the code more difficult to maintain or upgrade.

[1] http://theie7countdown.com/

[+] ErrantX|13 years ago|reply
This library solves a problem and solves it well. The local storage issue should be left up to other libraries who are designed to solve that gripe. :-)
[+] Hawkee|13 years ago|reply
I figure those folks using IE 6 or 7 are used to a lackluster internet experience. Little perks like this are not critical features and can be foregone for this small userbase.
[+] LearnYouALisp|13 years ago|reply
> don't let your users lose their form data

This is a huge problem, and is the reason I've had Lazarus installed for a few years now.

https://addons.mozilla.org/en-us/firefox/addon/lazarus-form-...

Apparently it exists for Chrome now, too.

[+] mikeash|13 years ago|reply
Thinking about it, I'm mildly amazed that the browsers themselves didn't solve this problem back in 1996 or so.
[+] anothermachine|13 years ago|reply
Form content recall is a native Chrome feature now.
[+] 5vforest|13 years ago|reply
Don't want to be that guy, but what's different from http://simsalabim.github.com/sisyphus/?
[+] guillaumepotier|13 years ago|reply
Oh, I was totally unaware of this one. Never mind, it clearly shows that there's a lack here on this browser behavior. My project is juste a few hours pet project. I'll try to maintain it and make it as advanced & usefull as sisyphus, for fun :)
[+] pyrotechnick|13 years ago|reply
Name, code, documentation, dependencies, browser support, test coverage, etc.
[+] stevoyoung|13 years ago|reply
Is there a way to differentiate between data that's only saved using Garlic (local) vs data that's also been saved to the server? This could be a huge confusion for users if there isn't.
[+] condiment|13 years ago|reply
I agree with this. Outside of explicitly signaling to users that they have a saved 'draft' of the form, and having them click a button on the page to restore their filled out fields from the draft, there aren't really very many sane implementations.

Some other issues: - doesn't work in IE - saved data doesn't expire - Storage keys aren't unique to the URL, so if two pages have the same exact layout, but different content, identical forms on the page will be filled out with stored information.

So it's a good concept, but I think that there are definitely some questions about user privacy, and that it needs to be paired with some extra UI cues that make it clear to the user that they're looking at draft information, and not something that's saved.

[+] guillaumepotier|13 years ago|reply
Yes, I'll need to work on that, if there is already server data. Maybe in a tooltip like, let the user choose which version he should use
[+] mmanfrin|13 years ago|reply
'Loose' is the opposite of 'tight'; to 'lose' is to misplace, which is the word you were going for.
[+] bookcasey|13 years ago|reply
Just a heads up, the <title> of your page is still "Bootstrap".
[+] pyrotechnick|13 years ago|reply
That was a test.

You passed.

[+] RBerenguel|13 years ago|reply
I just hope everyone gets to use it. I added it to my "great to have" Javascript libraries list. Good work!
[+] pratyushmittal|13 years ago|reply
Ruben, can you please share your "great to have" Javascript libraries list? It sounds promising.
[+] salman89|13 years ago|reply
Should add an option for users to disable this (like remember me on login forms)... not good for public computers if you don't know the form you just filled in but didn't submit will retain the data. Other than that, cool!
[+] wildgift|13 years ago|reply
Persisting localStorage seems to be controlled by the setting to delete cookies after exiting the browser. If i have it set to delete cookies, it deletes localStorage. if i allow it to keep cookies after quitting the browser, then it persists localStorage.

(Noticed this because the demo failed for me the first time.)

[+] astro1138|13 years ago|reply
While convenient and technically fine, this can get creepy for users. “Wait, I didn't submit the form on purpose but the data has been saved?”
[+] bluetidepro|13 years ago|reply
I had this same thought, but I think it would just be best to use these sort of plugins wisely, and not on every form element possible. Or to maybe have some sort of form "note/tip" that mentions it's being auto saved. Sites like Quora do this via drafts of your comments/responses that you write. That way people know to erase the content if they truly don't want it saved.

Like many UX features similar to this, I would say it mainly comes down to who your audience is, and where it's being used on how "weirded out" users would feel by this feature.

[+] guillaumepotier|13 years ago|reply
Hi there, github has some difficulties with the page url and tend to show some weird 404 :(

Please, could you update the link of this post to http://garlicjs.org?

Thx!

[+] program|13 years ago|reply
As a side note do not use the Bootstrap class .well together with .row cause it overflow because of padding. Create this structure: div.row > div.well > the content.
[+] guillaumepotier|13 years ago|reply
Thanks for your first comments ;) This is a very very early alpha release. 1h of work in fact.. Please, feel free to contribute!
[+] anothermachine|13 years ago|reply
Why is this a website feature instead of a browser extension, where it would work for every site?
[+] skndr|13 years ago|reply
I would imagine it's easier for a site owner to provide this than get everyone to install a browser extension.
[+] copypasteweb|13 years ago|reply
It should be a browser feature, option or extension, for users to have control over it from one place.
[+] csmatt|13 years ago|reply
I was thinking about this the other day and I thought "How is this not standard!?"

Good job!

[+] ceejayoz|13 years ago|reply
It's not standard because people frequently do things like type a credit card number into a form on a public computer. Lots of potential for privacy breaches.