Convert HTML form fields and values to a JavaScript object.