Avatar

Correct answer by
Level 7

Hi MDawn,

The populating of drop-down lists (DDL) is done in item pairs: addItem("DDL Item Text Displayed", DDL item value)   For instance: ("Item",1).

You can access the DDL item value using the exit event of the DDL. Placing a script there makes "this" refer to the DDL item value.

So, a script like

if(this.rawValue == "1"){

     subform1.presence = "visible";

}

will reveal the subform after the user selects a DDL item that has the value "1".

Also, you may want to consider using the preOpen of the DDL event to populate the 2nd drop-down box. It allows you to populate the dropdown when it is clicked--this allows you to do a number of things like check any objects value or multiple objects for their values before deciding what items should be populated into the drop-down box. It's pretty powerful way to do it because it opens up a whole range of things you weren't able to do otherwise.

Hope this helps.

Stephen

View solution in original post