'Dropdown choice depending on textbox value - adobe javascript

I am looking for a way to change dropdown value based on textbox value on an acrobat form.

Let's say dropdown choices are: "choice1", "choice2" and "choice3". If I enter "whatever" in the textbox, the selected dropdown choice should be "choice2". If nothing is entered into the textbox, I should be able to select the choice manualy.

I hope this is clear and thank you for your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source