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

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

Community Beginner ,
Aug 16, 2018 Aug 16, 2018

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
1.1K
Translate
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 = "";

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

What are the names of the two fields?

Translate
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

Upper field: ServiciosPlus-Tarjetasincluidas

Lower field: ServiciosPlus-Tarjetasincluidas10000

thanks!

Translate
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

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?

Translate
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

If smaller, leave it the same.... thanks!

Translate
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

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 = "";

Translate
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
LATEST

Thanks again! 🙂

Translate
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