Lava Shortcode - Text Box

Description

Display a single-line text input field.

Documentation

This control displays a textbox.

Example Usage
{[ textbox name:'lastname' label:'Last Name' value:'Decker' ]}
Parameter List

This control supports the following parameters:

  • label (Text Area) - The label to display above the control.
  • showlabel (true) - Whether to display label.
  • name (text) - The name for the text area control.
  • type (text) - The HTML input type (date, datetime-local, email, month, number, password, tel, time, url, week).
  • value - The text to initially set the control to.
  • size - Sets the vertical size of the input. Valid values: xs, sm, md, lg, xl, xxl.
  • width - Adjusts the width of the input. By default the width will grow to the size of the container. Valid values: xs, sm, md, lg.
  • preaddon - Places an add-on component before the input to provide extra context or functionality (like an icon or text). To place an icon here use the pattern <i class="fa fa-envelope"></i>.
  • postaddon - Places an add-on component after the input to provide extra context or functionality (like an icon or text). To place an icon here use the pattern <i class="fa fa-envelope"></i>.
  • isrequired (false) - Establishes whether making a selection is necessary.
  • validationmessage (Please enter a value.) - Message to display when the value is not valid.
  • additionalattributes - Additional attributes to include on the input control.

Markup

{% assign isrequired = isrequired | AsBoolean %}

{[ rockcontrol id:'rc-{{ '' | UniqueIdentifier }}' label:'{{ label }}' showlabel:'{{ showlabel }}' controltype:'rock-text-box' isrequired:'{{ isrequired }}' validationmessage:'{{ validationmessage }}' ]}

    {% if preaddon != empty or postaddon != empty %}<div class="input-group">{% endif %}

    {% if preaddon != empty %}
        <span class="input-group-addon">{{ preaddon }}</span>
    {% endif %}

    <input name="{{ name }}" type="{{ type}}" id="{{ id }}" class="form-control {% if size != empty %}input-{{ size }}{% endif %} {% if width != empty %}input-width-{{ width }}{% endif %}" value="{{ value }}" {% if isrequired == true %}required{% endif %} {{ additionalattributes }}>

    {% if postaddon != empty %}
        <span class="input-group-addon">{{ postaddon }}</span>
    {% endif %}

    {% if preaddon != empty or postaddon != empty %}</div>{% endif %}

{[ endrockcontrol ]}