Buttons

References
class crispy_forms_foundation.layout.buttons.ButtonHolder(*fields, **kwargs)

Bases: crispy_forms.layout.ButtonHolder

It wraps fields in an element <div class="button-holder">.

This is where you should put Layout objects that render to form buttons like Submit. It should only hold HTML and BaseInput inherited objects.

Example:

ButtonHolder(
    HTML(<span style="display: hidden;">Information Saved</span>),
    Submit('Save', 'Save')
)
class crispy_forms_foundation.layout.buttons.ButtonHolderPanel(field, *args, **kwargs)

Bases: crispy_forms_foundation.layout.buttons.ButtonHolder

Act like ButtonHolder but add a panel class name on the main div.

class crispy_forms_foundation.layout.buttons.ButtonHolderCallout(field, *args, **kwargs)

Bases: crispy_forms_foundation.layout.buttons.ButtonHolder

Act like ButtonHolder but add a callout class name on the main div.

class crispy_forms_foundation.layout.buttons.ButtonGroup(*fields, **kwargs)

Bases: crispy_forms.layout.LayoutObject

It wraps fields in an element <div class="button-group">.

This is where you should put Layout objects that render to form buttons like Submit. It should only hold HTML and BaseInput inherited objects.

Example:

ButtonGroup(
    Submit('Save', 'Save'),
    Button('Cancel', 'Cancel'),
)
class crispy_forms_foundation.layout.buttons.Button(name, value, **kwargs)

Bases: crispy_forms.layout.BaseInput

Used to create a Submit input descriptor for the {% crispy %} template tag:

button = Button('Button 1', 'Press Me!')

Note

The first argument is also slugified and turned into the id for the button.

class crispy_forms_foundation.layout.buttons.Submit(name, value, **kwargs)

Bases: crispy_forms.layout.BaseInput

Used to create a Submit button descriptor for the {% crispy %} template tag:

submit = Submit('Search the Site', 'search this site')

Note

The first argument is also slugified and turned into the id for the submit button.

class crispy_forms_foundation.layout.buttons.Hidden(name, value, **kwargs)

Bases: crispy_forms.layout.Hidden

Used to create a Hidden input descriptor for the {% crispy %} template tag.

class crispy_forms_foundation.layout.buttons.Reset(name, value, **kwargs)

Bases: crispy_forms.layout.BaseInput

Used to create a Reset button input descriptor for the {% crispy %} template tag:

reset = Reset('Reset This Form', 'Revert Me!')

Note

The first argument is also slugified and turned into the id for the reset.