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

Pull Export Values from Checkboxes to Show in a Text Field

New Here ,
Jul 29, 2019 Jul 29, 2019

Copy link to clipboard

Copied

I'm having some issues with this script. I've used it successfully, but slightly different than this version.

I have confirmed each checkbox has a export value, but I can't get it to display the checkboxs' export value within the text field I have it assigned to.

I'm using this in the "custom calculation" section:

var ybl = this.getField("Length.Youth").value ;

var abl = this.getField("Length.Adult").value ;

if(ybl <= 31) {

    event.value = (ybl.value) ;

}

if(abl >= 32) {

    event.value = (abl.value) ;

}

TOPICS
Acrobat SDK and JavaScript

Views

840

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 , Jul 30, 2019 Jul 30, 2019

Bernd is right. Change these lines:

event.value = (ybl.value) ;

event.value = (abl.value) ;

To:

event.value = ybl;

event.value = abl;

Votes

Translate

Translate
Community Expert ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

What if both of these conditions are true? Or neither?

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
New Here ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

They cannot both be true, as the the Length.Youth only goes up to 31 and the Length.Adult starts at 32 and goes up.

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 ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

OK. So what exactly is the issue? What do you see in the 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
New Here ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

Oops:

I did forget they do overlap at 31.

So Length.Youth can go upto 31 & Length.Adult starts at 31.

So I just need to pull the corresponding values from the two checkboxes ("Length.Youth" & "Length.Adult")

Youth goes from 27-31

Adult goes from 31-35

Currently, when any box is selected, it does not show any value. Sometimes it will randomly show a "3"

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 ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

Are there any error messages in the JS Console?

Can you share the file with us (via Dropbox, Google Drive, Adobe Document Cloud, 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
New Here ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

This is the error I'm getting:

InvalidSetError: Set not possible, invalid or unknown.

Event.value:14:Field PlayerBatLength:Calculate (the "event.value:XX" will change from 11, 14, 17 depending on the size checkbox selected)

I don't think I share with the world at this point.

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 ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

Bernd is right. Change these lines:

event.value = (ybl.value) ;

event.value = (abl.value) ;

To:

event.value = ybl;

event.value = abl;

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
New Here ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

LATEST

That was it! I should have noticed that. Sometimes the answer is to plain you don't even see it.

Thanks to both of 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
Community Expert ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

A value of a value makes no sense.

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