I have an HTML form that uses JavaScript to add controls to the form. For example, when a button on the form is clicked, a textbox is added to the form. When the user submits the form, the user is taken to another view. However, if the user clicks the back button on the browser, s/he is taken to the previous form (having the button to add controls) but none of the textbox s/he had added dynamically earlier is showing up. However, the other static form controls show up with the data previously entered. How can I have it such that pressing the back button returns to a complete previous state?Or do I need to implement this in a custom button? How can I do that?