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

use of event.value = this.getField("Text").value; and custom text

Explorer ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

I'm using Acrobat Pro 2017

I'm making a simple form for use at funerals. no big deal there.

 

I have a field called "1st Reading", which is a drop down. So the choices are OT-1, OT-2, OT-3, etc. Each of these has an export value of a Scripture verse that will be used. I also have as one of the choices OTHER, with no export Value. In the options tab, I also have checked allow user to enter custom text.

 

I have another field called "OT Reading" that uses "event.value = this.getField("1st Reading").value;" as a custom calculation script. It pulls the export value  from the "1st Reading" and fills in the blank fine.

 

My question. Is there a way to allow custom text when "OTHER" is selected from the drop down menu. The other values (OT-1, OT-2, etc.) would stay the same.  Families may want to use a Scripture verse that is not listed as an option. ATM, when I type in a scripture value, it just erases. If I type in, let's say "custom" in the "1st Reading" field, it just returns "custom" in the "OT Reading" field

 

Thanks for your help.

TOPICS
PDF forms

Views

2.0K

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

correct answers 1 Correct answer

Community Expert , Sep 06, 2022 Sep 06, 2022

As 'Validation' script of dropdown field ("1st Reading") use this:

var f = "";
for(var i=0; i<event.target.numItems; i++){
if(event.target.getItemAt(i, false)==event.value){
f = event.target.getItemAt(i, true);}}
this.getField("OT Reading").value = f;

Votes

Translate

Translate
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

As 'Validation' script of dropdown field ("1st Reading") use this:

var f = "";
for(var i=0; i<event.target.numItems; i++){
if(event.target.getItemAt(i, false)==event.value){
f = event.target.getItemAt(i, true);}}
this.getField("OT Reading").value = f;

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
Explorer ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

Thank you so much for your response!

However, it's not working. When I choose "OTHER" the fill in for OT Reading is "OTHER." When I went to type in a custom text, it just reverted to "OTHER."

Would seeing the file help? There isn't any private info to it.

 

https://drive.google.com/file/d/16Ukh89ce4UVbs2cWHG53DLXcFUIVWC3B/view?usp=sharing

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 ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

Remove script from "OT Reading" field.

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
Explorer ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

LATEST

Works! Thank You!

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