This is a Drupal module that integrates the cleave.js input field auto-formatter with the Drupal form-API.
This is pure API module without any UI. You only need to install it, when anoher module depends on it.
Dependencies
- libraries
- little_helpers ≥ 2.0-alpha6
- the cleave.js library.
Installation
Install this module and its dependencies like any other Drupal modules.
For installing the library:
- Go to https://github.com/nosir/cleave.js and download one of the releases.
- Put it in a libraries-folder as described in the libraries documentation. Make sure the folder is named
cleave.js.
Usage
When you add #cleave-property to any of your form-API elements Cleave will be invoked automatically on the resulting HTML element using this config.
Example:
$form['numeral'] = [
'#type' => 'textfield',
'#title' => t('Numeral'),
'#cleave' => [
'numeral' => TRUE,
'numeralThousandsGroupStyle' => 'thousand',
],
];
Devlopment
Development on this module is happening mainly on github. Feel free to post issues and pull requests there.
Note: Development branches on drupal.org might be outdated because they are only pushed to in order to tag releases.
Supporting organizations:
Development of this module
Project information
- Project categories: Developer tools, Integrations
6 sites report using this module
- Created by torotil on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
