{% extends "admin/base_site.html" %} {% load i18n %} {% block bodyclass %}grp-doc{% endblock %} {% block content-class %}{% endblock %} {% block title %}Grappelli Documentation » Form Fields{% endblock %} {% block extrahead %} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %}

Form Fields

You may use all common type of form fields with Grappelli. But there are some classes and specific types of form fields which are explained below.

Labels

To mark a label as required, simply add the class .required.

Note: Labels are outside Grappellis namespace because they are hardcoded with Django.

Module

{% filter force_escape %}

Module

{% endfilter %}

Form Field Widths

The following classes basically handle the widths of form fields in different contexts. They apply only to form fields which are not children of any grid-container (e.g. .g-d-c or .g-d-24). Form fields which are children of a grid-container always stretch to 100% width.

For more detailed information about the grid, take a look at the grid system we use.

Text & Numbers

.vTextField

.vLargeTextField

.vPositiveSmallIntegerField

Filebrowse, URL, XML

.vFileBrowseField

.vURLField

.vXMLLargeTextField

Date & Time

.vDateField

.vTimeField

Many to Many & Foreign Keys

.vManyToManyRawIdAdminField

.vForeignKeyRawIdAdminField

Read-Only Fields

Read-only fields are represented with div.grp-readonly.

Module

Read-only form field
{% filter force_escape %}

Module

Read-only form field
{% endfilter %}

Errors in Forms

Please take a look at errors in forms.

{% endblock %}