I'm trying to get this to work for a specific form created using the webform module that can be seen at http://test07v2.lightbeingcreations.org/contact

I've tried following the handbook instructions and have created a module for the hook with the code:

<?php
function HOOK_form_webform_client_form_12_alter(&$form) {
  $form['submitted']['models_of_interest']['#multicolumn'] = array('width' => 2);
  $form['submitted']['models_of_interest']['#process'][] = 'multicolumncheckboxesradios_element_process';
}
?>

which I've called multicheckhook.module

I've also created a multicheckhook.info file which looks like:

; $Id: multicheckhook.info,v 1.1 2010/08/25 06:50:42 lightbeingcreations Exp $
name = multicheckhook
description = Defines simple multicheckhook field types.
dependencies[] = content
package = Other
core = 6.x


; Information added by drupal.org packaging script on 2010-06-14
version = "1.1"
core = "6.x"
project = "multicheckhook"
datestamp = "25082010"

Uploaded them to my server and activated this module and the main Multi-column checkbox module

But nothing seems to have changed ont he form

Any suggestions why?

Comments

mattyoung’s picture

The hook you implement should be called multicheckhook_form_webform_client_form_12_alter()

See http://drupal.org/node/603900#comment-2228686 if that help you

also, you can add some debug print to see what's going on?

First, install the devel module,

then add dpm():

function multicheckhook_form_webform_client_form_12_alter(&$form) {
  $form['submitted']['models_of_interest']['#multicolumn'] = array('width' => 2);
  $form['submitted']['models_of_interest']['#process'][] = 'multicolumncheckboxesradios_element_process';
dpm($form);
}

You should see some print out at the top of the webform page. If you don't see anything, then the form hook name is wrong. In that case, view source on the webform page to find out the correct name. If you do see the print out, look inside to make sure you are targeting the right array element to add multicolumn settings.

mattyoung’s picture

Status: Active » Closed (fixed)