I came across this post when looking for a way to clear the entire form related to BFCache (back / forward button cache) in Chrome.
In addition to what Sim provided, my use case required the details that needed to be combined with the Clear form on the Back button? .
I found that the best way to do this is to allow the form to behave as it expects and to trigger an event:
$(window).bind("pageshow", function() { var form = $('form');
If you are not handling input events to create an object in JavaScript or something else in this case, then you are done. However, if you are listening to events, then at least in Chrome you need to fire the change event yourself (or any other event that you want to handle, including the custom one):
form.find(':input').not(':button,:submit,:reset,:hidden').trigger('change');
This should be added after reset for any good.
pickypg Apr 26 '13 at 7:56 2013-04-26 07:56
source share