I’m using the jQuery autocomplete plugin to get a list of locations, which works fine. But if the user clicks the browser’s back button after submitting the page with the autocomplete textbox, the textbox is empty. If I take the autocomplete off the textbox and submit & click back it remembers the text.
Is there a way to stop the autocomplete from clearing the textbox when the page loads?
Well I found the issue. It seems to be on Firefox, not IE, and it’s not technically due to the autocomplete plugin. It’s because the plugin adds the attribute
autocomplete='off'to the textbox.This is so that the browser’s autocomplete history doesn’t conflict with jquery’s autocomplete, but in Firefox, fields that have this attribute don’t get pre-populated when the user clicks the back button.
I’m guessing there isn’t a way around this, it appears to be the default browser behaviour. If anyone knows different please post a comment.