<div class="{% if id_prefix+'_text' in errors %}has-error{% elif id_prefix+'_text' in form_data %} has-success{% endif %}" style="padding-right:0.75em">
{% if 'multiline' in schema and schema['multiline']  %}
  <textarea class="form-control" style="resize: vertical;" rows="1" name="{{ id_prefix }}_text" placeholder="{{ (schema.placeholder or schema.title) | get_translated_text }}">{% if id_prefix+'_text' in form_data %}{{ form_data[id_prefix+'_text'] }}{% elif data is not none and "text" in data %}{{ data.text }}{% endif %}</textarea>
{% elif 'choices' in schema  %}
  <select class="form-control selectpicker" name="{{ id_prefix }}_text">
  {% if form_data.get(id_prefix+'_text', '') != '' or (data is not none and data.get('text', '') != '')  %}
    {% if not is_required %}
      <option value="">&mdash;</option>
    {% endif %}
  {% else %}
  <option selected="selected" value="">&mdash;</option>
  {% endif %}
  {% for option in schema.choices %}
    {% if id_prefix+'_text' in form_data %}
      {% if form_data[id_prefix+'_text'] == ( option | to_string_if_dict ) %}
      <option value="{{ option }}" selected="selected">{{ option | get_translated_text }}</option>
      {% else %}
      <option value="{{ option }}">{{ option | get_translated_text }}</option>
      {% endif %}
    {% elif data is not none and "text" in data %}
      {% if data.text == option %}
      <option value="{{ option }}" selected="selected">{{ option | get_translated_text }}</option>
      {% else %}
      <option value="{{ option }}">{{ option | get_translated_text }}</option>
      {% endif %}
    {% else %}
      <option value="{{ option }}">{{ option | get_translated_text }}</option>
    {% endif %}
  {% endfor %}
  </select>
{% else %}
  <input type="text" class="form-control" name="{{ id_prefix }}_text" placeholder="{{ (schema.placeholder or schema.title) | get_translated_text }}" {% if id_prefix+'_text' in form_data %}value="{{ form_data[id_prefix+'_text'] }}"{% elif data is not none and "text" in data %}value="{{ data.text }}"{% endif %}>
{% endif %}
</div>