Late comment about reloading text fields.
Using the Chrome version of version 54.0.2840.99 m on a PC running Windows 10 Home, I found that the built-in reset function, called by the regular / unmodified reset or form.reset () button, returns the original value of the textarea field, but only if the text field was not previously cleared programmatically, say, using a custom clear button that empties the innerHTML text area.
This is not observed when the text field is first loaded without a default value, but if the text field is encoded to display data from the previous publication of the form, then the text field may be empty and the text area should be reset to the value it had when loading forms.
I found that the textarea defaultValue attribute, which uses the native reset, does not clean up correctly when the innerHTML text area has been emptied, and then subsequent discards just clear the text field, rather than returning the text area as expected. I consider this a mistake, because compared to clearing and resetting other text input fields, textarea works differently.
This "odd-man" behavior can be handled by adding your own initialValue attribute to the text field and setting it to innerHTML. Since the built-in reset function and the user-defined cleanup function do not affect the user attribute, the value is saved and can be used to restore the textarea value by overriding the reset button to call a function that sets the innerHTML text field to the value of the initialValue attribute and then calls form.reset () to process other input fields. Note that calling the form.reset () function calls the reset function, called by the modified reset button, so as not to execute any code after form.reset ().
Howard brown
source share