Ajax Driven Dropdown Lists for ProcessWire made easy

Column Settings: Trigger

Here you enter the name of the column (in essence the dropdown) that will trigger the dynamic population of a dependent dropdown. For instance, you might have a dropdown named products whose data selections trigger the population of the <option> in a dependent dropdown price. In other words, if, say, a page editor selects a product Television in one dropdown, the price of the Television will be displayed in the adjacent dependent dropdown. 

Naturally, the first/initial dropdown cannot have a trigger dropdown. The data to populate the first column has to be separately defined as described earlier. For this reason, the trigger value of the first dropdown should always be 0 (zero). Saving the field with any other value will enforce a 0 value. 

It also follows that no other dropdown can have a trigger with a value of 0. Saving the field settings in that case will result in an error.

Please note that, for convenience, adding a column (i.e., a row in the columns settings HTML table) automatically populates the trigger value with the column name of the previous row. In other words, the previous column is auto-specified as the trigger for the new column.

A trigger input cannot be left empty. The trigger value must also be the name of a column that is either simultaneously being created with the dependent column, or one that already exists.