Skip to main content
Participant
Jun 9, 2020 10:21 AM UTC
Question

connect if/thenstatement with submit form function

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!

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

try67
Community Expert
Community Expert
Jun 9, 2020 2:58 PM UTC

Changed since when? Compared to what?

Translate
kwestionAuthor
Participant
Jun 17, 2020 9:58 AM UTC

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

Translate
Thom Parker
Community Expert
Community Expert
Jun 24, 2020 7:33 PM UTC

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. 

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often