HtmlForgeX

API Reference

Class

TablerSelect

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element
Implements

Dropdown/select element styled for the Tabler framework.

Inheritance

Constructors

public TablerSelect(String name) #

Initializes or configures TablerSelect.

Parameters

name System.String requiredposition: 0

Methods

public TablerSelect Floating(Boolean enable = true) #
Returns: TablerSelect

Render with Tabler floating label layout (form-floating). Ignored for inline label mode.

Parameters

enable System.Boolean = true optionalposition: 0
public TablerSelect Hint(String text) #
Returns: TablerSelect

Adds non-error help text below the control.

Parameters

text System.String requiredposition: 0
public TablerSelect Label(String text) #
Returns: TablerSelect

Sets the label text displayed above the select element.

Parameters

text System.String requiredposition: 0
The label text.

Returns

The current TablerSelect instance.

public TablerSelect Multiple(Boolean multiple = true) #
Returns: TablerSelect

Allows multiple items to be selected.

Parameters

multiple System.Boolean = true optionalposition: 0
Whether multiple selection is enabled.

Returns

The current TablerSelect instance.

Option 3 overloads
public TablerSelect Option(String text, Country country) #
Returns: TablerSelect

Adds a selectable option.

Parameters

text System.String requiredposition: 0
Display text for the option.
value System.String requiredposition: 1
Value submitted when the option is selected.

Returns

The current TablerSelect instance.

public TablerSelect Option(String text, String value, Action<TablerSelectOption> config) #
Returns: TablerSelect

Adds a selectable option with additional configuration (e.g., icon/flag, attributes).

Parameters

text System.String requiredposition: 0
Display text for the option.
value System.String requiredposition: 1
Value submitted when the option is selected.
config System.Action{HtmlForgeX.TablerSelectOption} requiredposition: 2
Optional configuration callback for advanced settings.
Option(System.String text, HtmlForgeX.Country country) #

Adds an option using a Country enum. Value is the ISO2 code (lowercase) and a flag is attached.

Parameters

text System.String required
country HtmlForgeX.Country required
public TablerSelect Options(IEnumerable<String> values) #
Returns: TablerSelect

Adds multiple options based on the provided collection of values.

Parameters

values System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
Values to use for both option text and value.

Returns

The current TablerSelect instance.

public TablerSelect OptionsFromAllCountries() #
Returns: TablerSelect

Adds options for all countries discovered on this platform (ISO 3166-1) with flags. Value is the ISO2 code (lowercase).

RegisterLibraries() #

Registers any required JavaScript libraries for enhanced select controls.

public TablerSelect Required(Boolean required = true) #
Returns: TablerSelect

Marks the select as required.

Parameters

required System.Boolean = true optionalposition: 0
Whether the select is required.

Returns

The current TablerSelect instance.

public TablerSelect Searchable(Boolean enable = true) #
Returns: TablerSelect

Enables client-side search functionality for the select element.

Parameters

enable System.Boolean = true optionalposition: 0
Whether search should be enabled.

Returns

The current TablerSelect instance.

public TablerSelect Selected(params String[] values) #
Returns: TablerSelect

Sets selected values for multi-select.

Parameters

values System.String[] requiredposition: 0
public TablerSelect TagsMode(Boolean enable = true) #
Returns: TablerSelect

Enable tags mode (free-creation). Uses TomSelect; no inline JS.

Parameters

enable System.Boolean = true optionalposition: 0
public override String ToString() #
Returns: String

Generates the HTML markup for the select element and associated script.

public TablerSelect Validation(ValidationState state, String message) #
Returns: TablerSelect

Sets validation state and message for the select element.

Parameters

state HtmlForgeX.ValidationState requiredposition: 0
Validation state.
message System.String requiredposition: 1
Message shown below the select.

Returns

The current TablerSelect instance.

public TablerSelect Value(String value) #
Returns: TablerSelect

Sets the selected value for single-select.

Parameters

value System.String requiredposition: 0