How can I create Checkboxes with Solspaces freeform. I only have text input and textfield options when created a new field. I need it for two reasons
the first:
I want the user to pick what services(checkboxes) they are interesting in:
the second: I need to add a checkbox to a solspace freeform for adding the sender to a mailing list. i know how to specify the mailing list just dont know how to add the checkbox.
KEvin
You can create the check boxes and then for the name attribute for each checkbox use something like “services[]”. This will put all the values of each checkbox into the services variable. Then in freeform create a textfield named services. You can call it in your freeform template. If that doesn’t work, check out example 3 here. He does it using a multiple select box.
I just gave this a try and it worked for me. In EE 1.6.8, used the following:
{exp:freeform:form form_name="volunteer_form" required="name|email"}
<input type="checkbox" name="volunteer_interests[]" value="advocate"/>
<input type="checkbox" name="volunteer_interests[]" value="friend"/>
<input type="checkbox" name="volunteer_interests[]" value="board_member"/>
<button type="submit">Sign Up</button>
{/exp:freeform:form}
With a Freeform text input field named ‘volunteer_interests’, checked values are added as a space-delimited string. Unchecked values are not added.
If indeed it fails for some reason, you could always store the values in a hidden field via javascript before submitting the form.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.