Generates a function to produce FormData objects based on a given HTML form.