Forums

Checkbox group results

brocars 02 Aug, 2016
Hi

I have a checkbox group in a form using the following code:
Please select which vehicles you would like to receive a quote for:<br><br>
<label>
                                  <input type="checkbox" name="vehicles" value="Audi S3 Quattro" id="vehicles_0">
                                  Audi S3 Quattro</label>
                                <br>
                                <label>
                                  <input type="checkbox" name="vehicles" value="Mercedes E Class" id="vehicles_1">
                                  Mercedes E Class</label>
                                <br>
                                <label>
                                  <input type="checkbox" name="vehicles" value="Mercedes S Class" id="vehicles_2">
                                  Mercedes S Class</label>
                                <br>
                                <label>

What do I have to add to the email template so we just receive the checked results?

Thanks
Paul
GreyHead 02 Aug, 2016
Hi Paul,

a. Change the input names to use an array name e.g. name="vehicles[]" - at present you will only get the last checked box submitted.

b. Drag a Handle Arrays action into the OnSubmit event and move it up before the Email action. This will convert the array to a comma separated string,

Bob
brocars 03 Aug, 2016
perfect, thanks a million

Paul
amheng5 29 Sep, 2016
Hi, I'm not sure if the "Change the input names to use an array name e.g. name="vehicles[]" - at present you will only get the last checked box submitted." appears when setting up email or on the design page. And then what you mean by [ ]. Do I need to enter the options names in the [ ]?

Here is what I have:
On design page
field name: membership
options:
Initial Payment=Initial payment of State & National dues sent to the State Office by December 1
Supplement Payment=Supplemental payment of dues for additional members sent on or before March 1
Issued Cards=Issued 2016-2017 Membership cards to members

Under setup page:
Added "Handle Arrays" above email (default setting)
Under Email:
<tr>
<td><b>MEMBERSHIP, DUES, AUDIT, BYLAWS , MEETING AND INSURANCE</b></td>
<td>{membership}</td>
</tr>

Not sure where to enter [ ] brackets.

thanks for your support.
GreyHead 30 Sep, 2016
HI amheng5,

It's the input element name:

field name: membership[]

Bob
This topic is locked and no more replies can be posted.