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

I have two boxes, Box 1 hase a drop down selection with the following ratings: Exceptional, Very Good, Marginal, Unsatisfactory. I need to express the rating as a numerical value (4, 3, 2, 1) in an adjacent second field.

New Here ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Here is the script I am trying to use but i recieve an error message: SyntaxError:missing) after condition 6: at line 7. What am I doing wrong?

var RB1 = this.getField("RatingBox1").value;

if (RB1 = Exceptional) {

    event.value = "4";

}

else if (RB1 = Very Good) {

    event.value = "3";

}

else if (RB1 = Satisfactory) {

    event.value = "2";

}

else if (RB1 = Marginal) {

    event.value = "1";

}

else if (RB1 = Unsatisfactory) {

    event.value = "0";

}

else if (RB1 = N/A) {

    event.value = "0";

}

if (isNaN(RB1) || RB1 === "") {

    event.value = "";

}

TOPICS
Acrobat SDK and JavaScript

Views

173

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 ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Chang this:

RB1 = Exceptional

To:

RB1 == "Exceptional"

etc.

On Fri, Jan 25, 2019, 14:46 reiserdkcwo3uscg <forums_noreply@adobe.com

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 ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Thanks.

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 ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

the code compiles but no value appears.

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 ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

LATEST

Do you know what this part of your code means?

isNaN(RB1)

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