Reputation: 5337
I have a formular, where you can edit a customers data. Below this there are 2 Buttons "Save" and "Cancel". Saving works fine, but if I click the cancel button, it should close the Formular and go back to the last page, which is the customer overview. How do I realize this?
Upvotes: 0
Views: 339
Reputation: 5337
<input action="action" type="button" value="Cancel" onclick="history.back();" />
Worked perfectly for this. Only had to end the php section and start it behind the funtion again
Upvotes: 0
Reputation: 66
You don't need PHP for that, just a bit of Javascript. Try this:
<input action="action" type="button" value="Cancel" onclick="history.back();" />
Upvotes: 1