How to store selected checkboxes to an array in the database

I have a collection that I am accessing and updating. The field I am specifically trying to update is an array. I want to populate this array with values from selected checkboxes. How can I do this via using the mapping with javascript? I tried the following without java script, but my array only got this result: ["Contacts_checkbox_item"]

Also, if it is of any importance, those checkbox items are dynamically generated from the database.

Thanks for any help!
2 people have
this question
This topic is no longer open for comments or replies.
  • Hi Chris,

    Here is solution for you:

    1 Open update service request mapping "array" request field.

    2 Delete links to this parameters and that one inside.

    3 click "JS".

    4 Populate with following code:

    //Where "mobilecheckboxgroup_20" your checkboxesgroup name. You should replace it with yours.
    var checkBoxes = Apperyio("mobilecheckboxgroup_20").find('input[type="checkbox"]');
    var checkBoxesState = [];

    for(var i = 0; i < checkBoxes.length; i++){
    var checkBox = jQuery(checkBoxes[i]);

    checkBoxesState.push({value: checkBox.val(), checked: checkBox.prop("checked"), view: checkBox.closest(".ui-checkbox").find("label").text()});

    return checkBoxesState;

  • (some HTML allowed)
    How does this make you feel?
    Add Image

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated