serialize the form in the proper order