onReady() error [SOLVED]

Hi Roi,
I’ve played around with the code some more.
Currently I have as the function we already saw:

export function button6_click(event, $w) {
    $w("#dataset1").onReady(() => {
 var tools = '';
 var strategies = '';
 for (var t = 0; t < 14; t++) {
            tools += selections[t];
        }
 for (var s = 15; s < 44; s++) {
            strategies += selections[s];
        }
        $w("#dataset1").setFieldValue('digital tools', tools);
        $w("#dataset1").setFieldValue('strategies', strategies);
    });
}

You see that I’ve changed the names to #dataset1 as you suggested. I’m not sure if this usage is correct how it is above.

Another function gets called upon a clicked checkbox, for example:

export function checkbox20_change(event, $w) {
    update_checkbox('#checkbox20', 'solar heat gain', 20);
}

There are no errors on the page, but on the other hand the tools += selections[t] lines don’t seem to work, because the function below never gets executed:

function update_checkbox(checkboxID, string, ID) {
 if ($w(checkboxID).checked) {
        selections[ID] = string;
        console.log(selections);
    } else {
        selections[ID] = '';
        console.log(selections);
    }
}

I was wondering why that could be…?