Copy link to clipboard
Copied
Hi everyone,
I am creating a dropdown menu, that contains answers to a questionaire.
Depending on the answer, a dialog box will pop up.
I need to refer to each item in the dropdown menu.
I read somewhere that each item in a dropdown menu has a number that can be referred to.
So, how do I refer to that number, so that I can trigger the correspondent dialogbox?
Thanks a lot for you reply in advance.
You are missing = at this line 'if (resposta = [0]) {'
it should be:
if (resposta == [0]) {
Copy link to clipboard
Copied
If you want to get number at which specific item is, then use "currentValueIndices"
if you want to get item at specific number then you can use "getItemAt()".
numbers starts from 0,1,2...etc so first item is 0, second item is 1...etc
Copy link to clipboard
Copied
Thanks a lot for your answer.
I understand it is possible to create a script using an IF clause in the Actions section of the dropdown menu,
to check the option selected and then trigger the dialog box.
In case yes, which trigger option should I select in the Actions section to release the dialog box? (for instance, On Focus).
Copy link to clipboard
Copied
I wrote the following code, but it keeps showing me only one dialog box (right answer), even when
I chosse a different option in the dropdown list.
var n = this.getField("Dropdown24");
var resposta = n.currentValueIndices;
if (resposta = [0]) {
app.alert("Correct answer. Congratulations!", 3,0)
}
else if (resposta != [0]){
app.alert("Incorrect answer.")
}
Copy link to clipboard
Copied
You are missing = at this line 'if (resposta = [0]) {'
it should be:
if (resposta == [0]) {
Copy link to clipboard
Copied
Thanks a lot! Now it worked.