Copy link to clipboard
Copied
Hello, i have a form with a email button. Is it possible when they hit the email button its clears all form fields. Because when some one else use the form they can start with a blank form.
I already tried the : this.resetForm(["P1.OrderForm.REVISIE","P1.OrderForm.OMSCHRIJVING TEKENING"]); javascript in the button field. But it doesn't work.
What is wrong?
Copy link to clipboard
Copied
If you want to clear all the fields in the file just use this code:
this.resetForm();
Copy link to clipboard
Copied
Thank you. That is the correct answer. please close this topic
Copy link to clipboard
Copied
Is it possible when they hit the email button its clears all form fields?
Yes, but this will send a blank form…
Copy link to clipboard
Copied
JR_Boulay you are right. i forget to check my forms. What can i do to send first the email and then clear the form?
Copy link to clipboard
Copied
Just change the order of the commands... First Submit Form, then Execute JavaScript. You can also use the built-in Reset Form command, by the way.
Copy link to clipboard
Copied
I have change the order of the commands. But it still send a empty form.
this is what i have. The language is dutch.

Copy link to clipboard
Copied
You should use the MouseUp event ("Muisknop loslaten").
Copy link to clipboard
Copied
Using individual actions may cause a problem because they will fire one after another whether the first action has completed or not. I would run a JavaScript to clear the form and then perform the submit action. JavaScript will not run the nest line of code until the current line of code has completed. For JavaScript statements that return a return code how the action has completed this will also allow one to control the flow of the script based on the return value.
Copy link to clipboard
Copied
I have tried several options. But i still receive a empty form. I have changed al most everything. Muis release, Muis press. Can someone please tell me exactly what i must fill in the form. Here below is the form.
Copy link to clipboard
Copied
gkaiseril is right. You should do it all in a script. Use this code:
this.mailDoc({cTo: "me@server.com"});
this.resetForm();
By the way, setting the dirty property as false is not a good idea, because then if someone closes the file they will not be prompted to save it, and it will still have the old data the next time they open it...
Copy link to clipboard
Copied
I've noticed you have set some fields as required... If you want to keep the validation of these fields then use this code, instead:
this.submitForm({cURL: "mailto:me@server.com", cSubmitAs: "PDF"});
this.resetForm();
Copy link to clipboard
Copied
PS. I don't think it's a good idea to reset the form like that. Maybe the user wants to save a copy of the filled-in form for their personal archives? You should at least ask them if they want to do it, or offer a separate button to reset it, instead of bundling it into the Submit button.
Copy link to clipboard
Copied
Thank you all for the great help. The form worked!!!
Copy link to clipboard
Copied
What can i do to send first the email and then clear the form?
Add:
this.resetForm();
this.dirty = false;
In the document action : When document will be closed.
So the user will not be prompted to save when closing the (resetted) form.
Copy link to clipboard
Copied
I don't think it's a good idea to reset the form like that…
I agree.
sjefd38453562 do not be surprised if a user comes to you with a gun in his hand !
![]()
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more