Hi Tal,
Thanks for the help and the links. I read through the link on Promises , and it’s complicated but I think I understand a bit better now.
The current issue is that button6 doesn’t become “grayed out” when the disable function executes. I want it to become grayed out when a person clicks on it. Do you know if this is possible…?
My code at the moment is below, given that I want to gray out the button and then send all the info gathered on the page (so I’m not including any other code inside the disable function).
export function button6_click(event, $w) {
$w('#button6').disable().then(() => {
console.log("Element now disabled");
})
$w("#dataset1").onReady(() => {
var tools = '';
var strategies = '';
for (var t = 0; t <= 14; t++) {
if (selections[t] !== undefined) {
tools += selections[t];
}
}
for (var s = 15; s <= 44; s++) {
if (selections[s] !== undefined) {
strategies += selections[s];
}
}
$w("#dataset1").setFieldValue('digitaltools_pdf', tools);
$w("#dataset1").setFieldValue('strategies_pdf', strategies);
});
}
The console.log message in the disable function gets displayed when the button is clicked, but it doesn’t gray-out.