I have a situation that I can't seem to find any help on. I looked through many questions on here, but can't seem to find anybody that has asked (or answered) my specific question. Here it is:
Assume I have 2 categories:
- Paper (id: 1)
- Plastic (id: 2)
The user clicks on Paper
, change the name to Plastic
, and click 'Submit'.
Inside my controller I discover that there is a already a category named Plastic
so I re-sends the page to the user with a friendly message.
The problem arises when the user decides to not change the value, and instead navigate away from the page. They do some other things and then click on Paper
again to change it's name. Only this time they actually see the name Plastic
in the textbox!?
I have this problem on all of my controllers when I reject invalid form data. How do I fix this problem?