Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Clear fields after pressing button

New Here ,
Jul 02, 2017 Jul 02, 2017

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?

TOPICS
PDF forms
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

If you want to clear all the fields in the file just use this code:

this.resetForm();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2017 Jul 02, 2017

Thank you. That is the correct answer. please close this topic

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

Is it possible when they hit the email button its clears all form fields?

Yes, but this will send a blank form…


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2017 Jul 02, 2017

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2017 Jul 02, 2017

I have change the order of the commands. But it still send a empty form.

this is what i have. The language is dutch.

Schermafbeelding 2017-07-02 om 13.33.26.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

You should use the MouseUp event ("Muisknop loslaten").

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 02, 2017 Jul 02, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2017 Jul 03, 2017

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.

Gedeelde bestanden - Acrobat.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2017 Jul 03, 2017

Thank you all for the great help. The form worked!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

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.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017
LATEST

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 !


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines