ui_range() form()

A jQuery UI slider for one value or a range, with hidden inputs that post the values.

form()->ui_range($name, $desc = '', $extra = [], $replace = [])

Options

OptionMeaning
min, max, stepLimits and step.
rangetrue for two handles (value_min, value_max).
value, value_min, value_max, valuesStart values.
orientation, animate, disabledSlider options.
feedback, create_inputs, hidden_inputsShow the values; post them through inputs.
slide_event, change_event, start_event, stop_event, create_eventJavaScript bodies of the slider events (site code).

Example

Code

return form(['price_from' => 100, 'price_to' => 400])
    ->ui_range('price', 'Price', ['min' => 0, 'max' => 1000, 'step' => 10, 'range' => true, 'value_min' => 100, 'value_max' => 400]);

Notes

  • Needs jQuery UI; for a plain slider without scripts use range().

See also: form/html5_inputs, demo:form/jquery_widgets