On this page
Basic functionality
Last updated on
23 September 2025
This documentation needs work. See "Help improve this page" in the sidebar.
Form API example
Notes on 3.x:
- The
#data-orientationis replaced with#orientation. You can still use#data-orientationbut it will be deprecated soon. - A a new
#dirattribute is available defaulting toltr
$form['example'] = [ '#type' => 'range_slider', '#title' => 'Rangeslider element', '#min' => 5, '#max' => 30, '#step' => 2, '#default_value' => 12, '#description' => 'Example range slider form element.', '#dir' => 'rtl', // Only available in 3.x '#orientation' => 'horizontal', // Only available in 3.x '#data-orientation' => 'horizontal', '#output' => 'below', '#output__field_prefix' => '$', '#output__field_suffix' => 'USD', ];
Help improve this page
Page status: Needs work
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion