I had this happen at work once, in the morning. Horrifying! I actually drove to a nearby mall and bought a new pair of jeans. The mall was much closer than my house, so was the lesser of two evils.

Another time, I spilled a full cup of coffee all over my pants. At this point, we lived much closer to my office, so I drove home and changed.

After that, I finally wised up and kept an extra pair of khakis in my office!