guillaumepotier / Garlic.js

Automatically persist your forms' text and select field values locally, until the form is submitted.

Home Page:http://garlicjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reuse values for fields with matching IDs

vilav opened this issue · comments

hi there

Just wondering if the values stored for a form on one page can be re-purposed for a form on another page of the same website if the ID / class of both forms can be matched? Is there a demo technique / some example of this being accomplished?

Thanks

Hi there,

Nope, that won't be an easy thing to do. Garlic does not rely on form/imputs names or ids, but rather on #forms and #elements in the page and their position/hierarchy inside.

If you want to do so, you'll have to implement your own localStorage/cookie logic.

Best