Meter form field type

From Joomla! Documentation

Revision as of 10:31, 15 May 2015 by Isuckatthis (talk | contribs) (Created page with "Draws a progress bar. (see [http://getbootstrap.com/2.3.2/components.html#progress here] for more details) * '''name''' (mandatory) is the unique name of the parameter. * '''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Draws a progress bar. (see here for more details)

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be meter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.
  • class (optional) specify your own classes for additonal markup, defaults to "combobox"
  • readonly (optional) set to "true", defaults to false, meaning editable.
  • disabled (optional) set to "true", defaults to false, meaning enabled.
  • size (optional) sets the input size of the field
  • required (optional) sets whether input is required, defaults to no input required.
  • default (optional) the initial value of the progress bar.
  • min (optional) the minimum value of the progress bar.
  • max (optional) the maximum value of the progress bar.
  • step (optional) the step at which the progress changes on the bar.
  • animated (optional)(default:true) sets whether the progress bar is animated or not.
  • active (optional)(default:false) sets whether the progress bar animation is active. Works with animated .

Note that without setting the min and max values it will probably not work as expected This is NOT an input type. It just create a progress bar

        <field name="meter"
               active="true"
               type="meter"
               label="Meter"
               max="1000"
               min="1"
               step="10"
               default="240"
               />

This will create the following HTML code

<div class="control-group">
  <div class="control-label">
    <label id="jform_meter-lbl" for="jform_meter" class="">
	Meter
    </label>
    </div>
       <div class="controls">
          <div class="progress  progress-striped" data-max="1000" data-min="1" data-step="1" data-value="233">		
             <div class="bar" style="width: 23.223223223223%;"></div>
          </div>
       </div>
    </div>
</div>