Form Helpers

OPAL comes with a selection of templatetags that can help you with the repetitive task of generating Bootstrap and OPAL compatible markup for your forms.

{% checkbox ... %}

Generates a checkbox

Keywords:

{% datepicker ... %}

Generates a datepicker

Keywords:

{% input ... %}

Generates an Input. If you pass a field, the tag will infer the label, model and lookuplist by introspecting the relevant subrecord model.

{% input field="allergies.drug" %}

Keywords:

{% radio ... %}

Generates an inline radio input

Keywords:

{% select ... %}

Generates an inline select input

Keywords:

{% textarea ... %}

Generates an inline textarea input

Keywords:

{% icon "icon-name" %}

Renders a Bootstrap style Icon tag. If the icon starts with fa or glyphicon then we will insert the preceding fa.

{% icon "fa-user-md" %}
<i class="fa fa-user-md"></i>

{% icon "cusom-icon"}
<i class="custom-icon"></i>