I don't think you understand what form.reset() does. What you describe is exactly how it is supposed to work. A reset() reverts changes made during a session and returns the form to its initial values. When you load a form to create an entry, the initial values of your input fields are empty unless you set default values for them. This is why reset() seems to "clear" the form. It isn't really clearing the form, it's resetting the fields to their initial values. When you edit a form, the initial values are the values you entered during form creation. If you change values or clear fields manually when editing a saved entry, reset restores what was there when the form was loaded for editing. If you want to really clear fields on an edit, you have to loop through every field in the fieldset and clear them with code.
Please login or Register to submit your answer