I have a form using jQuery that I need to manipulate the incoming data. The engine provides me a text field with decimal data, but it expects the POST data to be hexadecimal. So I convert it with jQuery to avoid the user from needing to re-enter it. Yes, I know it’s pretty dumb, but it’s out of my hands on the other end.
I tried to use addClass() to add a class (hexified) and then modified my selectors to not re-process. But when I reloaded the page with F5, Firefox kept the modified values, but cleared the class on me.
I tried making a hidden input that the server would ignore (so it always came back zero), but that seems to randomly not work.
I was thinking cookies, but that wouldn’t help if you had the page open in multiple tabs, or how would I clear, etc.
Any ideas?
In Firefox the problem is likely due to caching. FF caches form field values very aggressively.
If you can live with the other implications, just add
autocomplete="off"to the<input/>.