I'm hacking up a new element based on the grid.
Instead of radio buttons, I am using checkboxes.
Instead of a single value, checkboxes return an array.

The saving function can't cope with that, I don't see a way to serialize my data before it goes to be saved
One approach is to serialize the database field.
$tables['webform_submitted_data']['fields']['data']['serialize'] = TRUE;
However this will have other knock on effects I'm sure.

Comments

quicksketch’s picture

I don't see a way to serialize my data before it goes to be saved

Use _webform_submit_[component_name]() in your custom component. See how the date, time, and file components convert the data from arrays into string values in their submit functions.

quicksketch’s picture

Title: saving checkboxes » How do I save array (checkbox) values in a custom component?
Category: task » support

Updating title for clarity.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity.