Avatar

Level 10

The 1st thing is to get the value that the user selected in the listbox and to choose an event to execute your code. I woudl recommend the exit event rather than the change event (the user has committed to the value when he exits the field). To get the value of the listbox use the command:

this.rawValue

The "this" refers to the object that  is running the script.

Now to make other objects visible or invisible you can use the objects name and then the presence property. So the command woudl look like this:

ObjectName.presence = "visible"

Now that you have the basic commands you will need to evaluate what the user chose and act accordingly. So the command woudl look like this:

if (this.rawValue == "thing you want to check for"){

     Fieldname.presence = "visible";

     FieldName2.presence = "visible";

} else {

     Fieldname.presence = "invisible";

     Fieldname2.presence = "invisible"

}

If you have lots of selections in th edrop down list then you may want to look at a Select statement instead of nesting many if statements.

Paul