For Adobe ColdFusion application servers SpinEdit

The spinedit format is convenient for entering a number from a small range. The visitor can type the number or use the buttons to increment and decrement through a range. The mouse wheel is also supported, although pages with scrollbars may scroll. Spinedit requires the ResourcePath attribute to be set correctly in your opening cf_terraform tag or your settings file.

This control is based on code by Jon Hall.

Note: spinedit does not currently support comma as the decimal mark. In locales that use a comma as a decimal mark, do not use a non-integer step.

The following special attributes are available for spinedit:

  • Step
    Optional. The step size for increments and decrements. A positive whole number.
  • Wrap
    Optional. A boolean indicating whether the value should increase past the maximum value and return to the minimum, or decrement past the minimum value and return to the maximum. Both a minimum and a maximum value must be declared.

Other non-TerraField attributes will be passed through to the underlying text tag (<input type="text">). For example:

  • style="background-color : ##ccddff"
  • accesskey="A"
  • title="Push my buttons!"

Examples

A plain spinedit control:

<cf_terrafield
  name="MySpinEditField1"
  format="SpinEdit"
/>

spinedit with a minimum value:

<cf_terrafield
  name="MySpinEditField2"
  format="SpinEdit"
  min="0"
/>

spinedit with both a minimum and a maximum value, and wrap turned on:

<cf_terrafield
  name="MySpinEditField3"
  format="SpinEdit"
  min="1"
  max="10"
  wrap="yes"
/>

spinedit with a larger and negative step size:

<cf_terrafield
  name="MySpinEditField4"
  format="SpinEdit"
  min="0"
  max="100"
  step="-10"
/>

spinedit with a smaller step size:

<cf_terrafield
  name="MySpinEditField5"
  format="SpinEdit"
  min="0"
  max="1"
  step="0.01"
/>

No comments yet