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
| Option | Meaning |
|---|---|
min, max, step | Limits and step. |
range | true for two handles (value_min, value_max). |
value, value_min, value_max, values | Start values. |
orientation, animate, disabled | Slider options. |
feedback, create_inputs, hidden_inputs | Show the values; post them through inputs. |
slide_event, change_event, start_event, stop_event, create_event | JavaScript 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