Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.
EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
What is it?
The missing range slider Inputfield for Processwire.
What does it do?
This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
It includes a visible and editable value field, to override/tweak the value if required.
Features
Min/max values
Precision (number of decimals)
Optional step value (Read more)
Optional manual override of the selected value (will still adhere to the rules above)
Configurable rounding of manually entered values (floor, round, ceil, disable)
Usage
Clone / zip repo
Install FieldtypeFloatRange, this automatically installs the Inputfield
Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field.
To render the field's value simply echo `$page->field`
Demo
A field with Min=0, Max=1, Step=0.2, Precision=2
Field with settings Min=0, Max=200, Step=0.25, Precision=2
Todo
Make the display-field's size configurable (will use the Input Size field setting)
Hopefully become redundant
Changelog
008 (current version)
- Add composer.json and submit to Packagist, making the module installable via composer
007
- Add defaultValue field (as requested by @charger)
- Fix a silly mistake where a negative rounding (-1) resulted in removing all decimals instead
006
- Fix bug where InputfieldFloat negative precision prevented the displayed value to be updated properly
- Revert installs & requires, so direct installs from Modules Directory (should) work
005
- Fix bug where the Inputfield would not work properly within repeaters / repeater matrices
004
- Make rounding of manually entered values configurable (floor, round, ceil or disable)
- Fix small JS bug where the value-display field was not displayed
- Update README
003
- Code cleanup, add some ModuleInfo data & LICENSE
- Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
002
- Fix issue where setting the step value to an empty value created problem with validation
- Make the display-field optional
001
- Initial release
Thanks!