connect if/thenstatement with submit form function

New Here ,
Jun 09, 2020

Copy link to clipboard

Copied

Hello Community,

I was wondering if I can combine the if then statment with the submit form function. 

 

I already managed to send specific data of specific fields to an email address after hitting the "submit form" button I created.

 

I was wondering if I can just send the fields where information has been changed? 

 

if "data in field A was changed" then send it

if "data in field has not been changed" don´t send it

 

Thanks in advance!

TOPICS
Acrobat SDK and JavaScript, PDF forms

Views

144

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

connect if/thenstatement with submit form function

New Here ,
Jun 09, 2020

Copy link to clipboard

Copied

Hello Community,

I was wondering if I can combine the if then statment with the submit form function. 

 

I already managed to send specific data of specific fields to an email address after hitting the "submit form" button I created.

 

I was wondering if I can just send the fields where information has been changed? 

 

if "data in field A was changed" then send it

if "data in field has not been changed" don´t send it

 

Thanks in advance!

TOPICS
Acrobat SDK and JavaScript, PDF forms

Views

145

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 09, 2020 0
Most Valuable Participant ,
Jun 09, 2020

Copy link to clipboard

Copied

Changed since when? Compared to what?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2020 0
New Here ,
Jun 17, 2020

Copy link to clipboard

Copied

The fields should already be prefilled and if the information changes, then it should be sent 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 17, 2020 1
Adobe Community Professional ,
Jun 24, 2020

Copy link to clipboard

Copied

Yes, you can do this.  The "doc.submitForm()" function includes a parameter for submitting specific data fields. 

https://acrobatusers.com/tutorials/submitting-data/

 

The trick is detecting which fields have changed. The easiest way to do this is to save a list of all the current field values to a hidden field when the PDF is submitted. Then compare the values on the next submit. This is an advanced scripting task. 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 24, 2020 2