I've been trying to find a workaround to the back button bug in Safari/Chrome (browser putting bogus data in fields where they don't belong). I haven't had any luck, and it seems like there should be a good solution to this by now (I see posts about this going back to 2009, but no good solution).
In this example: http://jsfiddle.net/eGutT/13/
you can see that everything is fine on the initial page load. However, after clicking the link, then clicking the back button on the browser, values are propagated the the wrong fields. Please use Safari or Chrome to test. It works fine on Firefox.
This is a very serious problem, especially when:
- User goes hits the back button, and this bug occurs
- User doesn't notice the bogus data
- User makes some unrelated change to the form (in a different unaffected field)
- User submits form
Now you are left with a situation where the bogus data is committed to the database!!
BTW, this problem may be related to jQuery, since if you uncomment this line in the example:
updateRowNums(); // IF YOU COMMENT OUT THIS LINE...
no extra/bogus data gets introduced.
Thanks, Galen