I'm using the Create Item save action in a web form. I have a checkbox list that points to a folder containing category items. This is mapped to a Multilist field on the item template that it will create when the user submits the form. But it's passing the checkbox text, not the value, so the multilist for each new item created has bad data in it. Does anyone know how to set the checkbox list to pass the values instead? I'm kind of surprised it's doing this in the first place.
Sitecore WFFM checkbox values on Create Item
898 views Asked by Jason Davidson At
1
I haven't had a chance to test this, but theoretically, you could create a new field type that inherits from
CheckboxList
, and let's say we call itCheckboxListPipedValues
. The code would look something like this:In Sitecore, simply go to
/sitecore/system/Modules/Web Forms for Marketers/Settings/Field Types/List Types/Checkbox List
and duplicate that item. Then change the assembly and class to the new control. Change your form to use the new field, and ensure that the values are mapped properly. Now the output of the value should be a pipe separated list of the values which should work nicely with the multilist field.EDIT: For MVC, it's the same process, but you'll need to update the
MVC Type
in the field type item to point to your new class. The code for MVC should look something like this: