Forums

Only the last value of checkbox gruop is in the array

BLolka 16 Jun, 2014
Hi,

Only the last selected value of a checkbox group is in the array in case of multiple selection.

Thank you for your help in advance,
Laci
GreyHead 16 Jun, 2014
Answer
Hi Laci,

Do you have an array name for the checkbox group e.g. checkbox[] ?

Bob
BLolka 16 Jun, 2014
Hi Bob,

Oh, what a banal mistake... I forgot the brakcets [] at the end of the name of the checkbox group. :-$
Thank you for your help again.

Have a nice day,
Laci
dzseti 25 Jul, 2014
Have the same problem - added [] to Field Name (not Field ID) but this still does not produce an array as output😟
dzseti 25 Jul, 2014
The code from the resulting html looks like this - no key is inserted into the Field Name:


<div class="List1" id="List1">
    <div class="form-group gcore-form-row" id="form-row-14">
        <label for="fld13" class="control-label gcore-label-left"> </label>
        <div class="gcore-input gcore-display-table" id="fin-fld13">
            <p style="font-size: 14px; font-weight: 700; margin: 10px 0 0 0;">Melyik La Praline termékeket szoktál vásárolni?</p>
        </div>
    </div>
    <div class="form-group gcore-form-row" id="form-row-24">
        <label for="list1" class="control-label gcore-label-left gcore-label-checkbox"> </label>
        <div class="gcore-input gcore-display-table" id="fin-list1">
            <div class="gcore-single-column" id="fclmn23">
                <div class="gcore-checkbox-item" id="fitem14">
                    <input name="list1[]" id="list113" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="L0" />
                    <label class="control-label gcore-label-checkbox" for="list113">Cukrásztermékek</label>
                </div>
                <div class="gcore-checkbox-item" id="fitem16">
                    <input name="list1[]" id="list115" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="L1" />
                    <label class="control-label gcore-label-checkbox" for="list115">Francia macaronok</label>
                </div>
                <div class="gcore-checkbox-item" id="fitem18">
                    <input name="list1[]" id="list117" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="L2" />
                    <label class="control-label gcore-label-checkbox" for="list117">Kenyerek és péksütemények</label>
                </div>
                <div class="gcore-checkbox-item" id="fitem20">
                    <input name="list1[]" id="list119" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="L3" />
                    <label class="control-label gcore-label-checkbox" for="list119">Sós piték, sós aprófalatkák</label>
                </div>
                <div class="gcore-checkbox-item" id="fitem22">
                    <input name="list1[]" id="list121" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="L4" />
                    <label class="control-label gcore-label-checkbox" for="list121">Sütemények és torták</label>
                </div>
            </div>
        </div>
    </div>
</div>
dzseti 25 Jul, 2014
And the answer to my own question (for anybody else who has the same issue)!

The FIeld Name should NOT include a number - there is no problem with Listone[], but List1[] doesn't work!
This topic is locked and no more replies can be posted.