Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Unlimited Number Field

Security covered Maintenance fixes only

3.x is functionally identical to previous version, except it requires Drupal 11.4 and later. We are using a new major primarily as a method to excise sites who depend on this project because of a legacy RNG installation, not because they need it in the current day.

Adds a custom render element and field widget allowing the user to choose "Unlimited" or a number value.

The unlimited_number element renders a radios form element with an inline number field. Custom prefix and suffixes can be applied to the number field. The radio labels can also be customized.

This field eliminates the UI oddity where form descriptions will often request the user to leave a field empty, set to 0, or set to -1, where an unlimited value takes effect.

Support requests are taken on Drupal Answers with the fields tag. Ask a question!

Discontinued Github project.

Usage

Form Element

// Define an unlimited_number form field.
// Only the #type key is required.
$form['my_field'] = [
  '#type' => 'unlimited_number',
  // Optional properties:
  '#title' => $this->t('My field'),
  '#description' => $this->t('Choose an option.'),
  '#default_value' => 1, // an integer, or the string 'unlimited'.
  '#required' => TRUE,
  '#options' => [
    // Customize the labels on the radios element.
    'unlimited' => $this->t('No limit'),
    'limited' => $this->t('Fixed value'),
  ],
  // The following are applied to the number field.
  '#min' => 1,
  '#max' => 128,
  '#step' => 1,
  '#field_suffix' => 'units',
  '#field_prefix' => NULL,
];

Field Widget

The field widget can be applied to any existing number field.

  1. Go to the Manage fields page for an entity type.
  2. Add a Number (integer) field if one does not yet exist.
  3. Go to Manage form display page.
  4. Locate the Widget select element located adjacent to your number field. Change the existing value to Unlimited or Number. Save the form.
Drupal 11 · not 10 PHP 8.3

Ask your assistant about Unlimited Number Field

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Nov 2026
Latest release
2 hours ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.0.0 Stable 11 PHP 8.3 Nov 3, 2026
3.x-dev Dev 11 PHP 8.3 Nov 3, 2026
2.0.5 Stable 10–11 PHP 7.4 Nov 3, 2026