Make page to tell browser not to cache/preserve input values

Posted by queen3 on Stack Overflow See other posts from Stack Overflow or by queen3
Published on 2010-04-23T14:21:56Z Indexed on 2010/04/23 14:23 UTC
Read the original article Hit count: 344

Most browser cache form input values. So when user refreshes page, the inputs have same values.

Here's my problem. When user clicks Save, server validates POSTed data (e.g. checked products), and if not valid, sends it back to browser. However, as stated above, even if server clears selection for some values, they may still be selected because of browser cache! My data has invisible (until parent item selected) checkboxes, so user may be even not aware that some previous value is still selected, until clicks Save again and gets error message - even though user thinks it's not. Which is irritating.

This can be resolved by doing Ctrl-F5, but it's not even a solution.Is there automatic/programmatic way to tell browser not to cache form input data on some form/page?

© Stack Overflow or respective owner

Related posts about html

Related posts about html-form