Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Problem with listbox

lpianwi
Level 4
Level 4

Good afternoon all,

I am having problem with the following code. I have 3 items in a listbox. This code should populate the drop down list depending on what is selected in the list box. It is however, not working. 

Please I need help with the code below,

On calculate event;

If(Listbox1.rawValue==1){

DropDownList1.rawValue="P";

}

else if (Listbox1.rawValue="2"){

    DropDownList1.rawValue="J" 

}

else if (Listbox1.rawValue="3"){

    DropDownList1.rawValue="H" 

}

else if (Listbox1.rawValue="4"){

   DropDownList1.rawValue=null;

  xfa.host.setFocus(DropDownList1);

}

Thanks

v/r

Tammy

2 Replies
whyisthisme
Level 7
Level 7

try putting the code into the exit event of the listbox

GeneveveX
Level 3
Level 3

I agree with whyisthisme. For some reason, putting code on the "change" event of a listbox doesn't seem to work. You have to put it under the exit event.

radzmar
Level 10
Level 10

The reason it doesn't work is that the rawValue does not exist when the change event occurs.

The grab a value during the change event use "xfa.event.newText" instead.