Pergunta

I'm working on a page with 9 inputs and js that performs logic on those inputs before submitting it. It's getting really annoying having to enter the information into the forms every time I want to see my javascript changes.

Is there a way to refresh the page without clearing the form?

P.S. I'm working in IE9+, Chrome, Firefox, and Safari.

Thanks in advance!

Foi útil?

Solução

Apparently, there are few tools (if any) that do this (at least that I was able to find). I've found a way to do this by writing a script that hijacks the window event loop and stores all the input values in a stringified cookie. When you refresh the page, you can use window.onload to automatically repopulate the inputs.

If you (understandably) don't want to write your own script to do this, I've written one you are welcome to use on github.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top