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

Needing script

Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

I'm working on a fillable form in Adobe and need assistance with a dynamic text box. The text box should populate based on a dropdown selection, with a specific criteria that varies depending on a secondary dropdown selection. I'm having trouble developing the script to achieve this functionality and would appreciate any guidance or support.

TOPICS
PDF , PDF forms

Views

183

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Enter the following custom calculation script in the text field, changing the field names and values to the actual field names and values:

if(this.getField("Dropdown1").value=="valueA" && this.getField("Dropdown2").value=="valueB")

{event.value="valueC";}

else

{event.value="";}

Votes

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
community guidelines
Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Thank you. Just so I understand, I would put what I want valueC to be inside {event.value="";} correct?

 

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

No.  That line gives the field no value if the conditions are not met.  You would replace valueC with what you want the value to be.

Votes

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
community guidelines
Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Also I have one dropdown that says something seperate and after putting this in, neither will populate.

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Check the Console for error messages. You probably entered some field name incorrectly.

Votes

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
community guidelines
Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

I am new to writing script. This is what I have minus the suggestion from up top. Would using this format mess it up?

 

var f = this.getField("Text5");
if(event.value == "MPI")
f.value = "2. Leaders are responsible for issue and withdrawal of credentials are to report the name, SSN, DOB and credential number for individuals who have had credentials issued or withdrawn within 5 days of the issue or withdrawal. Please list date of withdrawal not the date of destruction. Withdrawal message must state the reason. Please list the date credential was issued if different from the date on the message.";
else if(event.value == "MWD")
f.value = "2. ***PLEASE NOTE*** this message is not to be given to the individual listed above. It is for official use only.";
else if(event.value == "PSD")
f.value = "2. The point of contact for this memorandum is below;
else if(event.value == "DACP")
f.value = "2. Your  inquiry has been processed in accordance with AR 190-56 paragraph 2- 4(b), for employment security screening procedures.";
else if(event.value == "DASG")
f.value = "2. Your  inquiry has been processed in accordance with AR 190-56 paragraph 2- 4(b), for employment security screening procedures.";
else if(event.value == "SAM")
f.value = "2. Your  inquiry has been processed in accordance with AR 195-3 paragraph 2-6b(3), for employment security screening procedures.";
else if(event.value == "PCF")
f.value = "2. Your inquiry has been processed in accordance with AR 600-62 paragraph 3-1 (b), for initial processing into Personnel Control Facility.";
else

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

If the is set to the Date format then you can't apply any value to it that doesn't match that format, so yes, that code would cause an issue. Like I said, change its Format to None and try it again.

Votes

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
community guidelines
Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

All the formats are set at none and still nothing. To me it seems like there is an issue because I have "MPI" specifing text despite what the Dropdown5 says.  

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

Your script has at least one error.  Your are missing a closing quote after the "PSD" condition.  Where is the script located (field, calculation/validation, etc.)?

Votes

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
community guidelines
Community Beginner ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

I do have the closing quote but accidently deleted it will putting it on here. Everything is located under the validation for the "Billet#0" box

Votes

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
community guidelines
Community Expert ,
Dec 30, 2024 Dec 30, 2024

Copy link to clipboard

Copied

LATEST

You need a line of code after the last word else.  I put event.value=""; and it worked for me.

Votes

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
community guidelines