1

What should I implement for Cancel button, so that when user presses it, screen returns to the previous values for all editable fields?

I have a button:

<button type="submit" id="btnCancel" name="Command" value="Cancel">
  Cancel
</button>

and method in controller that handles POST events for submit type. Not sure whether I should handle abort of changes via this way; or have some jQuery to handle this in the view. Could you please advise?

nice ass
  • 16,471
  • 7
  • 50
  • 89
user2911759
  • 61
  • 2
  • 10

1 Answers1

1

I think you would want to change your button like this...

<button type="reset" id="btnCancel" name="Command" value="Cancel"> Cancel </button>

DEMO

Charlie74
  • 2,883
  • 15
  • 23