I know jquery has [.serialize()](http://api.jquery.com/serialize/) for that.