Hello,
I have a ‘submit’ page where there are various inputs from users and upon clicking “submit” the info is going to be saved in a collection.
I also have 2 lightboxes on the same ‘submit’ page, which I want users to click BEFORE they submit the whole page, and the users should click some ‘checkbox’ buttons inside the lightboxes, click ‘save’ in the lightboxes, and this will save additional data to the collection and return to the ‘submit’ page.
What currently I can’t figure out is:
-
is it possible to save data this way into a collection?
-
should I instead save the selections people made in the lightboxes and only the main ‘submit’ will push that into the collection? if so, how do I do that?
-
I have some code trying to save to a collection from the lightbox checkboxes upon ‘save’:
import {ifc_data}
from 'backend/ifc_data.jsw';
var picks = [];
export function checkbox1_click(event, $w) {
picks += 'compact volume';
}
export function checkbox3_click(event, $w) {
picks += 'advanced envelope';
}
$w("#ifc_data").onReady(function () {
$w("#ifc_data").setFieldValue("strategies", picks);
});
console.log(ifc_data);
console.log(picks);
The error in the console log is :
“Error: The element selector function (usually $w) cannot be used before the page is ready”
Would appreciate any help on these issues,
Thanks.