Added my contribution to serialize javascript objects into the form data