Ajax: Restore form to initial values
My web application has a form with four select elements. Just the first one has data. When user selects the first one, the second one is populated with data and so on. After submission, users can click on back button. If they do that, the form gets messy. To prevent this, I want to restore the form to the initial value. How could I do that when back button is开发者_Python百科 pressed? Thank you.
I'm not sure if you are using a framework or not so my answer is in pretty generic terms.
I think you should be able to set the "selected" option for the select elements at the time of the page load event. That was a nasty sentence...
Trying again, you could forcibly choose a particular option (the default) at the time the page load event is triggered.
精彩评论