Replace a Webform fieldset (group) by a formatted table

If you have several repeating fields in fieldsets in your webform, you may want to render these in a HTML table with the header along the first row or first column.

Here's a recipe to do so adapted from this post http://1013.fi/cms/theming-drupal-web-forms

Declare your formatting functions in a file called 'form-formatting-helpers.php' which you should copy to a subdirectory under your themes directory. For example:

/sites/default/themes/mytheme/webform_templates/form-formatting-helpers.php

<?php
// By David Ruderman druderman@admin.umass.edu
// adapted from http://1013.fi/cms/theming-drupal-web-forms

/**
* Replace a form fieldset (group) by a table formatted as:
* +----------+--------------+--------------+
* | | name | ssn |
* +----------+--------------+--------------+
* | spouse | [input /] | [input /] |
* +----------+--------------+--------------+
* | another | [input /] | [input /] |
* | fieldset | | |
* +----------+--------------+--------------+
*
*
* @param $group - reference to the fieldset
* @param $label_rows - if true, rows have leading label column
*/
function fieldset_subfieldsets_to_table( &$group, $label_rows=FALSE ) {

Webform Layout (Spanish Vídeo)

Módulo Webform Layout , añade la funcionalidad de alinear los campos de webform horizontalmente y guarda compatibilidad con el resto de funciones.

https://vimeo.com/49686417

Subscribe with RSS Subscribe to RSS - Webform Layout