I spend a lot of time writing bespoke content management systems, a lot! I'm always trying to add some small, lightweight additions to make the user experience a little bit better. One means of doing this is by providing some better custom controls which give good user feedback and emulate similar offline controls.
One such control is a linear range control, catchy I know, which allows the user to select a value within a particular range with a given default value. An example of this may be selecting an ordering value for a blog post, Figure 1, ranging from say -100 to 100 with a default value of 0. Posts in our imaginary blog would be ordered by this ordering field ascending with 0 being the default value, resulting in posts being ordered automatically by date. Rather than using a plain text box to allow the user to enter the ordering value directly, subsequently giving us little or no control over the contents of the field until the form is submitted and no means to convey the nature of the field itself, we can create controls to manipulate the value ourselves.
Creating a custom control allows us to do a number of things that we just cannot do with a normal HTML form element:
- Display relevant information instead of certain values, such as showing Automatic at 0 in Figure 1
- Show when the upper and lower bounds are reached, for example at -100 and 100 as per our example
- Allow the user to reset the value to the default or previous setting
- Give some inkling into how the control should be used