I've got a rather advanced form that posts to a preview page:
The preview page which is reached when pressed continue looks like this
Now I want to implement the "go back and edit ad" button but just javascript history -1 didn't do it since the form fields are not remembered. I write the fields to the datastore when doing a preview and if user goes back it can be a complete new submit with a new id and the old entity doesn't get posted since it has the variable submitted=false or likewise.
Now I couldn't enable the back button using javascript, do you have any idea how I can implement my button "go back and edit ad"?
I'm using wtforms, jinja2 templates and webapp2.
Add a 'draft' flag to your Ad datastore model. When the form is submitted, create the record with the draft flag set as True and have the 'Edit Ad' button link back to the form with the with the key as a GET variable. Prepopulate the form with the data from the draft record and when the user hits 'Post Ad; set the draft flag to False.
This has the added advantage of giving you a mechanism for allowing your users to resume their workflow from an old session if, for example, they accidentally close their browser.