Public Service Announcement - Firefox Caches Select Box State
Remember that the Firefox Browser caches the selected position on Select Boxes. I am not sure how to turn this feature off.
This means that if you select an option on a select box, and refresh, firefox will remember your select box index position. I've noticed the same behaviour on checkboxes and radio buttons, so be aware when debugging.
Heuristically speaking, I like the function, especially when filling out long involved forms. It is however, a complete pain in my MULE when I am debugging applications and can't figure out why the box isn't selected to the expected option.
Pressing CTRL+F5 redraws everything sans state.







Answer... in the onload function of your page... or using your favorite AJAX library you you access the form you want to refresh. Now there is a second issue that you may not know of... but let's deal with the first solution.
document.getElementById('myFormId').reset();
Now for the secondary issue. Not all browsers create the submit or reset functions if you put a reset or submit button on the page. If those buttons are on the page then you run the click() function on the buttons. It will work the same that way as the above solution.
<form autocomplete="off"></form>
don't use autocomplete="off" for production, it will tick people like me off. The new mozilla browsers re-introduced this as it was introduced, then removed from netscape in version 4.x
Its really handy during testing and development so you don't have to re-type your test data!!
personally, i really like the form to always reflect the values the application is setting...
otherwise the caching can overwrite existing values that have been changed by someone else..not so good..
The autocomplete trick did the job perfectly, thanks for sharing this.
I admit it's a very convenient "feature" especially with long text fields, but it got me crazy.
Cheers!