Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for Show only | Search instead for Did you mean:/t5/acrobat-discussions/reset-all-form-fields-to-default-value/td-p/12468283 Oct 23, 2021 Oct 23, 2021
Copy link to clipboard
it is me again.
I am trying to reset a form when clicking a reset-button.
Currently i used the function resetForm(Fields) but i want to reset the fields to the default value which is given in the preferences/settings.
So i thought about looping all fields and put value to defaultValue but then my Acrobat freezes.
var fieldstoteset = ["Field1", "Field2", "Field3"]; if(4==app.alert("The form will be resetted.\n\nAll data will be removed! Continue?",1,2))
if(4==app.alert("The form will be resetted.\n\nAll data will be removed! Continue?",1,2)) < for (var i = 0; i < this.numFields; i++) < var fieldname = getField(getNthFieldName(i); this.getField(fieldname).name).value = this.getField(fieldname).defaultValue; >this.getField("top").setFocus(); >
Many thanks in advance for your hints