I'm thinking to arrays. I think the most convenient way of passing them is to serialize them and put them in an hidden field. I've tried a cheap trick already but I quickly came into it's limits.
I've written the serialize function, which was really easy to do. Now I'm writing unserialize. It's more challenging. Too bad I don't know these regex better.