I've modified the signup_form.inc in theme folder as documented. I can get the checkboxes to display on my signup form when someone signs up, but I'm not sure that I'm using them properly as I get saved back to the form (when I view the signups) values like:
1:1
0:0
or I can get it back like this (depending on how I format my array.. see below my sample code):
Apples:Apples
Oranges:Organes
Pears:0
Bananas:0
Here's what I want: While I would like to see the name of the checkbox field, followed by only the values that were selected as names not digits. For example I would expect to see the following.
If my check boxes where displayed on the form as:
Existing Products: []Apples []Pears []Oranges [] Bananas
Than what I am trying to achieve is when I view the signups, if the user selected on the form "Apples" and "Oranges":
Existing products:
Apples
Oranges
Here's an example of what I'm doing:
$products = array(
'Apples' => t('Apples'),
'Pears' => t('Pears'),
'Oranges' => t('Oranges'),
'Bananas' => t('Bananas')
);
$form['signup_form_data']['ExistingProducts'] = array(
'#type' => 'checkboxes',
'#title' => t('Existing products'),
'#options' => $products,
'#prefix' => '<div class="my_signupcheckboxes">',
'#suffix' => '</div>'
When I examine the HTML that's generated, it looks like this:
<div class="form-item" id="edit-signup-form-data-ExistingProducts-Apples-wrapper">
<label class="option" for="edit-signup-form-data-ExistingProducts-Apples">
<input type="checkbox" name="signup_form_data[ExistingProducts][Apples]" id="edit-signup-form-data-ExistingProducts-Apples" value="Apples" class="form-checkbox"> Apples</label>
</div>
Is this an issue with Signups or how I'm doing it? Not sure what I'm doing wrong. Help! :)