Highlighted

populate pdf form fields based on condition

New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

Hello everyone,

 

I already have a pdf form created and populating the same based on the submission data from the web app. Form has a radio button with options YES and NO and is mapped to 'intrested' in the property name. And have two textbox both mapped to 'reason' in the property. 

My requirement is like:

if  intrested = 'yes' then populate textbox1 else populate textbox2

Any advice how can i achive this.

Thank you!

 

 

TOPICS
Create PDFs, PDF forms

Views

45

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

populate pdf form fields based on condition

New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

Hello everyone,

 

I already have a pdf form created and populating the same based on the submission data from the web app. Form has a radio button with options YES and NO and is mapped to 'intrested' in the property name. And have two textbox both mapped to 'reason' in the property. 

My requirement is like:

if  intrested = 'yes' then populate textbox1 else populate textbox2

Any advice how can i achive this.

Thank you!

 

 

TOPICS
Create PDFs, PDF forms

Views

46

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
Nov 10, 2020 0
Engaged ,
Nov 10, 2020

Copy link to clipboard

Copied

In textbox1 you could use something like this:

if(this.getField("Intrested").valueAsString == "Yes"){

event.value = here goes field name that contains data you want to populate;}

else event.value = "";

 

for textfield2 just change "Yes" to "No"

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...
Nov 10, 2020 0
New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

Thanks for your time! But every time I add the validation script on the second textfield it overwrites the script from the first textfield. 

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...
Nov 10, 2020 0
Adobe Community Professional ,
Nov 11, 2020

Copy link to clipboard

Copied

Use the script at calculation, not at validation.

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...
Nov 11, 2020 0
Most Valuable Participant ,
Nov 10, 2020

Copy link to clipboard

Copied

Is this an LCD form?

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...
Nov 10, 2020 0
New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

sorry, i'm kind of new to this. what is an LCD form ?

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...
Nov 10, 2020 0
New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

I'm invoking a server script through a API for fetching and populating the form

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...
Nov 10, 2020 0
New Here ,
Nov 10, 2020

Copy link to clipboard

Copied

here is some more details (with screenshot): 😄 

PJ003_0-1605070934166.png

both the checkbox have a property name of selectType with options export value as primary and group respectively, if primary option is selected textfield1 should be populated with property name of amountValue. if contingent is selected then textfield2 should be populated with property name of amountValue. 

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...
Nov 10, 2020 0
Contributor ,
Nov 10, 2020

Copy link to clipboard

Copied

First you said you have radio buttons with options yes and no, now somehow those radio buttons magically transforms into checkboxes with export values of primary,group and contingent. Can you decide which one is it primary and group or primary and contingent?

Anyway the code above should suffice just change field name and Yes to primary and No to contingent.

You are very confusing, you should describe more clearly what you need.

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...
Nov 10, 2020 0