The best thing you can do is try to escape the elevator car through the ceiling door and then do your business into the crevasse between the elevator car and the elevator shaft so your poop falls down to the bottom. If that's not possible then just going on the roof of the elevator is the next best thing. If by some chance there is no way to get on top of the car then you have to go to plan B.
Plan B involves taking off your coat or shirt and pooping into that. This seems weird (and it is) but the idea is that it can soak up the mess and keep it from flowing all over the elevator floor which can be awful if you've got liquidy stools. Then an added bonus is that when you finally are freed from the elevator you have your turds wrapped in a neat little bundle that you can then throw away or rinse off before washing the shirt to wear again one day. It sounds bad, but it definitely beats the elevator crew showing up and seeing a bare pile of crap sitting in the corner of the elevator.