Skip to main content
Known Participant
August 16, 2018
Answered

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

  • August 16, 2018
  • 1 reply
  • 1285 views

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

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!

This topic has been closed for replies.
Correct answer try67

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


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

1 reply

try67
Community Expert
Community Expert
August 16, 2018

What are the names of the two fields?

Known Participant
August 17, 2018

Upper field: ServiciosPlus-Tarjetasincluidas

Lower field: ServiciosPlus-Tarjetasincluidas10000

thanks!

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 17, 2018

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


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