Allows for a slider with an option for markers or labels.
- Display a slider with markers
- Allow for varying step size
- Allow for displaying the value
The field value will be the last value indicated on the slider. This will be an integer for an integer field or a decimal for a decimal field.
Feature / Property | Support |
---|---|
Supported field type(s) | integer, decimal |
Default values | Yes |
Constraint message | Uses default behavior |
Required message | Uses default behavior |
Read only | Yes (shows the current value, if present) |
media:image | Yes |
media:audio | Yes |
media:video | Yes |
- Download the test form extras/sample-form from this repo and upload it to your SurveyCTO server.
- Download the slider-label.fieldplugin.zip file from this repo, and attach it to the test form on your SurveyCTO server.
- Make sure to provide the correct parameters (see below).
The plugin can take up to 5 parameters:
min
- The lowest value in the range of permitted values.max
- The greatest value in the range of permitted values.markers
- can take three values. -none - slider will have no markers. -yes - slider will have markers at set intervals (determined by the step parameter). -labels - slider will have labels and markers.step
- The step attribute is a number that specifies the granularity that the value must adhere to. The default is 1 for integer and 0.1 for decimals.display_value
(optional) - use this to display the current value of the slider below the slider.
Examples usage is as follows:
custom-slider-label(min="0", max="100", markers="none")
custom-slider-label(min="0", max="100", markers="yes")
custom-slider-label(min="0", max="100", markers="labels")
custom-slider-label(min="0", max="1", markers="labels", step=0.1)
custom-slider-label(min="0", max="10", markers="labels", step=1, display_value="yes")
You can find a form definition in this repo here: extras/sample_form. This form will help you create a sample form to test the functionality of the field plug-in.
- Source resources
This field plug-in uses Slider Pips which you can use for further customization. - Developer documentation for field plug-ins
More instructions for developing and using field plug-ins. https://github.com/surveycto/Field-plug-in-resources