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

Interactive Form Using PRINT/RESET/EMAIL Buttons

Community Beginner ,
Oct 07, 2016 Oct 07, 2016

First off, I'm a novice when it comes to creating interactive forms.  I created a document in Word 2016, then used Adobe Acrobat DC to "create a form".  Then used the PREPARE FORM tool to auto-add the fields.  The last thing I did was add 3 buttons to the bottom of the form for PRINT, RESET and EMAIL.  The GENERAL/COMMON PROPERTIES/FORM FIELD for each button is set to "Visible but doesn't print".  I want to know if there is a way to have all 3 buttons [mainly the RESET button] disappear and not be part of the final form once the User clicks on the EMAIL button.  When the email recipient opens the completed form submitted by the User, I don't want the buttons to be on the filled-out form to where the email recipient could accidentally click on the RESET causing all the entered information to be deleted.  If there is a way to at least have the RESET button disappear from the final .pdf received from the User, that would help.  I thought it logical that all of the buttons would not be shown or continue to be part of the final .pdf once the User clicked the EMAIL button to submit the form but it appears it doesn't work that way.

Keep in mind that I'm a novice so please be kind and use easy-to-understand step-by-step instructions.  Your assistance is much appreciated.

TOPICS
Acrobat SDK and JavaScript , Windows
1.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
Enthusiast ,
Oct 07, 2016 Oct 07, 2016

1) Right Click on the email button and select "properties" menu item

2) Navigate to the "Actions" tab

3) Create a new JavaScript action for the MouseUp event

4) Paste the code below in the JavaScript editor

5) Save the form

6) View PDF form in Adobe Reader

Note: slashes // are JavaScript comment lines

// CODE START

try{

//  Use the reset button's name not RESET BUTTON NAME

var f = this.getField("RESET BUTTON NAME");

f.display = display.hidden;

// Change to desired recipient

var to = "you@domain.com";

// Change to desired subject, body, cc, bcc

var strUrl = "mailto:"+to+"?subject=SUBJECT TEST&body=BODY TEST&cc=&bcc=";

// PDF format

var submitAs = "PDF";

// Submit Form

this.submitForm({cURL: strUrl, cSubmitAs:submitAs});

}catch(e){app.alert(e);}

// CODE END

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 ,
Oct 08, 2016 Oct 08, 2016

If you want to prevent the fields from being edited after the form is submitted, hiding that button is not sufficient.

You should either set the fields as read-only, or (better yet) have the user digitally sign the file and then have the signature fields lock the fields.

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 Beginner ,
Nov 07, 2016 Nov 07, 2016

try67,

Thank you for your assistance with the buttons & how to make them disappear on the final signed form received by the recipient.

I inserted the javascript as you shared in your reply earlier and it worked except...

Here's the process I encountered when testing the form. I entered data & checked the check boxes as I made my way through the form.  The digital signature field is located 2/3rds of the way down the form with two additional data fields immediately following.  After that, the remaining fields in the bottom section of the form are for the email recipient to enter additional information.  Once I digitally signed the form [as the user], I am forced to save the new .pdf containing my digital signature and it then took me back to the form to fill in the last two fields.  Then when I clicked the EMAIL button, there is a hesitation and an Outlook email opens, prefilled with the email address specified in my JavaScript and a subject line of "Form Returned: {name of form}".  The body section of the email is prefilled with the message "Form Returned: {name of form}.  The attached file is the filled-out form. Please open it to review the data." Question: Do I send this email to the recipient or is it generated for my [the User] review purpose only?  My computer is locked up until I send the email.  Then after another hesitation, a 2nd auto-generated email opens, again prefilled with the email address specified in my JavaScript and a subject line of "{the name of the form}".  The body section of the email is prefilled with the message "BODY TEST".  The completed/signed form is attached as well.  Question: Why is the EMAIL button on my form generating two different emails, both with the signed form attached?

In regard to preventing the fields from being edited after the form is submitted, how do I do that but still allow the bottom section fields to remain open so the recipient can enter necessary information on the completed/signed form they just received from the customer?

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 ,
Nov 07, 2016 Nov 07, 2016

- You probably just added two Submit commands. I can't say for sure without seeing the actual file.

- You can use a script to set the rest of the fields as read-only after the form is submitted. It's not as secure as locking them using a Digital Signature, but it will work in most cases, and it's basically the only option you have, short of re-signing 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 Beginner ,
Nov 07, 2016 Nov 07, 2016

You were right, I did have two Submit commands.  I corrected that and it fixed the double email situation.

Would you be able to help me with my other dilemma which is how to lock all the Customer fields in the upper section once the Customer applies his/her digital signature but yet still leave the remaining fields in the bottom section open for me to enter data once it is received by email from the Customer?  I don't know how to attach or submit the link for the form so you can see exactly what I've done in building 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 ,
Nov 07, 2016 Nov 07, 2016
LATEST

Didn't you already achieve that by setting the signature field to lock those fields?

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