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

How to change a dropdown list selection based on a condition of another field

Community Beginner ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

Hi, I would like a dropdown list be on a certain item based on a number on another field.

Singular Fact captura _444.jpg

So basically if I write a number on the field at the bottom that is higher than 10000, I want the upper field to show the option "Más de 10000". And if the user changes the selection on the upper field to any other option (except "Más de 10000"), remove whatever number it is on the bottom field.

Many thanks!

TOPICS
Acrobat SDK and JavaScript

Views

900

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 , Aug 17, 2018 Aug 17, 2018

OK. Then as the validation script of the text field enter this code:

if (Number(event.value)>10000) this.getField("ServiciosPlus-Tarjetasincluidas").value = "Más de 10000";

And as the custom validation script of the drop-down field enter this:

if (event.value!="Más de 10000") this.getField("ServiciosPlus-Tarjetasincluidas10000").value = "";

Votes

Translate

Translate
Community Expert ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

What are the names of the two fields?

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 ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

Upper field: ServiciosPlus-Tarjetasincluidas

Lower field: ServiciosPlus-Tarjetasincluidas10000

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
Community Expert ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

OK. What about if they enter a number smaller than 10K in the text field, though (or clear it entirely)? Should it change the value of the drop-down, or leave it the same?

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 ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

If smaller, leave it the same.... 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
Community Expert ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

OK. Then as the validation script of the text field enter this code:

if (Number(event.value)>10000) this.getField("ServiciosPlus-Tarjetasincluidas").value = "Más de 10000";

And as the custom validation script of the drop-down field enter this:

if (event.value!="Más de 10000") this.getField("ServiciosPlus-Tarjetasincluidas10000").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 ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

LATEST

Thanks 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