Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store values #12

Open
peteruithoven opened this issue Jan 27, 2015 · 2 comments
Open

Store values #12

peteruithoven opened this issue Jan 27, 2015 · 2 comments

Comments

@peteruithoven
Copy link
Member

Firefox will store the values of fields, so that when you refresh you keep the values in fields like url. Chrome doesn't.
Is there a input field option to enable this?
Otherwise we might want to store this in localStorage.

@peteruithoven
Copy link
Member Author

I tried adding autocomplete="on" and autosave to the input element, but this doesn't help.

It looks like Chrome doesn't store it unless it's actually submitted, I prevent the submit using a event.preventDefault(); to prevent a page refresh. Using return false in a submit handler gives the same behavior.

@peteruithoven
Copy link
Member Author

Having a iframe as form target seems to solve the autocomplete issue in Chrome...
Example:

<iframe name='hidden-iframe' class='hidden' src='about:blank'></iframe>
<form target='hidden-iframe'>
...
</form>

You won't need event.preventDefault(); or return false with this solution.
From:
https://stackoverflow.com/questions/15462991/trigger-autocomplete-without-submitting-a-form
https://stackoverflow.com/questions/22163220/prevent-page-reload-after-form-submit-node-no-ajax-available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant