You know those annoying times when you fill out a large form, submit it, and a post back to the server is performed. But, horror of horrors, you made a mistake, and the page prompts you to make a correction, but the password (or credit card number or whatever) field was cleared! I hate that.
I had an instance where I was that annoyance, and it was keeping me up at night, tossing and turning, worrying what I could do to solve that issue. (That’s sarcasm right there, people.) So after a very brief bit of research, I found this code snippet to fix the problem:
Yes, that really is it. I just put that code at the end of my submit button’s click event.