This project is not covered by Drupal’s security advisory policy.

Adds Form API support for the Range module.

Features

Adds the following Form API render elements:

  • Here, answer the following questions: What is the basic functionality? What unique features does enabling this project add? When and why would someone use this module? What use cases are there?

Includes theme suggestions for --range form elements and input elements.

Post-Installation

Once enabled, add to your forms as follows:

$form['my_range'] = [
  '#default_value' => [
          'from' => 1,
          'to' => 1,
        ],
        '#from_label' => $this->t('Min'),
        '#max' => 1000,
        '#min' => 1,
        '#title' => $this->t('Range'),
        '#to_label' => $this->t('Max'),
        '#type' => 'range_integer',
  ],
];
$my_range = $form_state->getValue('my_range');
$from_val = $my_range['from'];
$to_val = $my_range['to'];

Additional Requirements

Supporting this Module

Sponsor me at https://github.com/sponsors/cybtachyon

Supporting organizations: 
Sponsoring development

Project information

Releases