Ahhhh... the jack-in-the-box milestone. I remember it well.
How you handle it (and the success) seems to depend very much on the LO. We went through hell with this stage (about a month of it) until I changed my approach. Initially I did as everyone recommended which was to lay him back down each time, as eventually he would get the message. But my DS never did. Or more to the point; he got the message straight off but just wasn't what he wanted to do.
I had another friend going through similar (less extreme) around the same time. She'd been to a sleep consultant who works in a very BW way and passed on a few advice titbits to me. Which I followed. So, from then on when he stood up I said 'lie down, it's time to sleep'. I patted his mattress where his head should be. If he was really upset, I would comfort (I wouldn't pick up until absolutely necessary) by stroking his head or cheek, and then repeat 'lie down, it's time to sleep' and pat the mattress. Sometimes I'd take his lovie and place that on the mattress where his head should be, stroke its head etc. And then I would move back to wherever I was sitting on his floor, so I wasn't sitting right next to his cot. I'd wait. When he lay down, I would say 'good boy, that's right', time to sleep now'. And wait. If he stood up, I'd say again 'lie down, etc'. There were times that I would lie him down: if he'd woken & was upset / sleepy, I would lie him down and stroke his head before waiting at the door until he was asleep. But if he stood up again, I stuck to the above approach.
Basically, I gave him complete control over whether he was going to stand up or lie down to go to sleep. It's a huge development for them. I can't blame them for wanting to practice their new trick. Giving my DS the right to exercise this skill when he wanted, worked well for us. He did it all day long. And in bed, well, was up to him to lie down. It worked pretty fast for us.
And so it went. It didn't take long. I did this at the same time as a GW program where I was moving further away from his bed each night and closer to the door. Once at the door / on the other side, I rarely needed to tell him to lie down that much as by then, he would lie down to go to sleep.
My friend did something slightly different, but she didn't lay her daughter down either (with the above exception). She gently rubbed / stroked the back of her daughters leg for a moment and said 'lie down, time to etc'. She didn't sit on the floor as I did, but lay on another bed in the room, putting her head on her hands in a sleeping position. And showed her that it was sleep time. She'd repeat the 'lie down' bit, and get up to rub her legs if needed.
For she and I, the lay down approach just didn't get us anywhere other than a long hard fight at every night and nap, with unhappy Mamas and babies.
HTH
Charlotte