Webform class

Component ID

2425633

Component name

Webform class

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Overview:

The Webform Class module provides an easy way to add CSS classes to webform forms, avoiding the problems of styling with CSS selectors based on form ids that can change between developement/production sites and making easier to reuse styles across different forms.

The module also adds an extra class to the form with the view mode: e.g. webformclass-full, webformclass-teaser, etc.

Usage:

Add a text field (single value) to your webform content type and select "Webform CSS Classes" as formater in the displays.

The text entered as field value will be added to the form class attribute. You can set several class names separating them with spaces. The values are filtered using drupal drupal_html_class(), so they can differ from your input. Avoid surprises using just lowercase letters, numbers and hyphens.

Configuration:

The only (optional) parameter to configure is a "target" field.
Specifying a target field avoid performance loss. If no target field is defined the module will have to scan all fields to check if they are they using the "Webform CSS Classes" formatter to add the classes from those field. It's more efficient if you specify a single target field to take in account in the module settings (and don't forget to use the 'Webform CSS Classes' formatter in that field).