To add a JavaScript script to the drop-down box to display the selection in an alert:
Open Sample1mod.bqy, activate the Limits Dashboard section, and change to Design mode.
Double-click DropDown1 to display the Properties dialog box, change the Name field to drp_Territory, and then click OK.
Open the Script Editor for the drop-down box.
Right-click drp_Territory (changed from DropDown1)—which should still have handles around the box—and select Scripts from the shortcut menu.
Expand Methods and Properties for Limits DashboardDashboard Objects., then drp_Territory.
To see both methods and properties for drp_Territory, scroll down, or click the striped arrow below the scroll bar to expand the Elements pane.
Double-click the Item method to enter drp_Territory.Item() in the Script Editor.
drp_Territory.Item()
Place the cursor inside the parentheses of the Item method, and then double-click SelectedIndex from the Properties folder.
Type a semicolon (;) and a return [Enter] at the end of the line.
drp_Territory.Item(drp_Territory.SelectedIndex);
The SelectedIndex property of a drop-down box is the index number (or position number) of the selected value. Item() uses this argument to return the text the user selected.
Add a new statement using the Alert method with the drop-down selection as its argument.
Click OK to save the current script and close the Script Editor.
Toggle to Run mode, click the arrow in the drp_Territory drop-down box and select an item.
Selecting an item causes a popup message to is displayed.
The Alert method displays a popup message that contains the name of the item selected from the drop-down box.