Dynamic List Fields

A field’s settings can be set dynamically when the form is rendered on the page – this is when the field data is “localized” to the page for use by the form.

Dynamic Field Settings

The list field types uses a list options’ selected setting to determine the default value(s) of a field. This is different than the textbox field, which uses the default_value setting to set the value of the field.

Related Filters

add_filter( ‘ninja_forms_render_options’, ‘my_callback’ );

add_filter( ‘ninja_forms_render_options_’ . $field_type, ‘my_callback’ );

Example

Example Setting Selected Option

Example Add Options

Example Adding Options Before (or After)

Example using the Country List